diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-10-02 19:55:16 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-10-02 19:55:16 +0200 |
commit | 1ca193f4acc8c7f51e5313458cf984e6279f17b9 (patch) | |
tree | ef734ba93466821d604f4028495f7c48567a79da | |
parent | 5491e8d57e0fd8e46ad986cefbb9c57201380cde (diff) | |
download | Ishtar-1ca193f4acc8c7f51e5313458cf984e6279f17b9.tar.bz2 Ishtar-1ca193f4acc8c7f51e5313458cf984e6279f17b9.zip |
set_localisation: do not raise an error for an empty value if localisation is not defined
-rw-r--r-- | archaeological_finds/models_finds.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 811e6be74..891d99d28 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -1075,11 +1075,13 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, ImageModel, def set_localisation(self, place, context, value): if not self.container: + if not value: + return raise ImporterError(_(u"No container have been set - the " u"localisation cannot be set.")) localisation = self.container.set_localisation(place, value) - if not localisation: + if value and value != '-' and not localisation: raise ImporterError( unicode(_(u"The division number {} have not been set " u"for the warehouse {}.")).format( |