@@ -358,6 +358,9 @@ def set_identifiers(self, identifiers):
358358 else :
359359 self .identifiers [name ] = value
360360
361+ if not d .items ():
362+ self .identifiers = None
363+
361364 def get_classifications (self ):
362365 names = ["dewey_decimal_class" , "lc_classifications" ]
363366 return self ._process_identifiers (
@@ -388,6 +391,9 @@ def set_classifications(self, classifications):
388391 else :
389392 self .classifications [name ] = value
390393
394+ if not self .classifications .items ():
395+ self .classifications = None
396+
391397 def get_weight (self ):
392398 """returns weight as a storage object with value and units fields."""
393399 w = self .weight
@@ -779,7 +785,6 @@ def get_identifiers(self):
779785
780786 def set_identifiers (self , identifiers ):
781787 """Updates the work from identifiers specified as (name, value) pairs."""
782- names = ()
783788
784789 d = {}
785790 if identifiers :
@@ -793,10 +798,10 @@ def set_identifiers(self, identifiers):
793798 self .identifiers = {}
794799
795800 for name , value in d .items ():
796- if name in names :
797- self [ name ] = value
798- else :
799- self .identifiers [ name ] = value
801+ self . identifiers [ name ] = value
802+
803+ if not d . items () :
804+ self .identifiers = None
800805
801806 def _process_identifiers (self , config_ , names , values ):
802807 id_map = {}
0 commit comments