Uploaded image for project: 'BookBrainz'
  1. BookBrainz
  2. BB-169

Identifier.update doesn't work properly.

XMLWordPrintable

      Identifier.update doesn't work properly.

      bbschema/entity.py:Identifier.update
          def update(self, identifier_json):
              new = self.copy()
      
              if 'value' in identifier_json:
                  new.value = identifier_json['value']
              if 'identifier_type_id' in identifier_json:
                  new.identifier_type_id =\
                      identifier_json.get('identifier_type', {}).\
                      get('identifier_type_id')
      
              return new
      

      It should be :

      bbschema/entity.py:Identifier.update fixed
          def update(self, identifier_json):
              new = self.copy()
      
              if 'value' in identifier_json:
                  new.value = identifier_json['value']
              if 'identifier_type' in identifier_json:
                  new.identifier_type_id =\
                      identifier_json.get('identifier_type', {}).\
                      get('identifier_type_id')
      
              return new
      

            lordsputnik Ben Ockmore
            stanislas Stanisław Szcześniak
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                February 2016 (2016-02-09)