diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-03-13 23:42:57 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-03-13 23:42:57 +0100 |
commit | a34de39510494325d2b33aa1a4bc5fbf00368b5b (patch) | |
tree | 0b9c554692352c7e16919a4358fc2a24fb0bdf4e /archaeological_operations/models.py | |
parent | a0bc331d6a48f334f145063e6695696045d92c13 (diff) | |
download | Ishtar-a34de39510494325d2b33aa1a4bc5fbf00368b5b.tar.bz2 Ishtar-a34de39510494325d2b33aa1a4bc5fbf00368b5b.zip |
Allow simultunaeous creation of operations: remove operation_code field (refs #3070)
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r-- | archaeological_operations/models.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 945af21a4..d0a010d6a 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -427,6 +427,8 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem, # put a default year if start_date is defined if self.start_date and not self.year: self.year = self.start_date.year + if self.operation_code is None: + self.operation_code = self.get_available_operation_code(self.year) return super(Operation, self).save(*args, **kwargs) m2m_changed.connect(cached_label_changed, sender=Operation.towns.through) |