fix bug with LocationById.__set__

This commit is contained in:
Laura Klünder 2019-12-27 16:52:58 +01:00
parent da07faf3cb
commit f7b830ca6a

View file

@ -30,6 +30,7 @@ class LocationById():
return value return value
def __set__(self, instance, value): def __set__(self, instance, value):
self.cached_id = value.pk value_id = None if value is None else value.pk
self.cached_id = value_id
self.cached_value = value self.cached_value = value
setattr(instance, self.name+'_id', value.pk) setattr(instance, self.name+'_id', value_id)