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 | e5252a6f73d073227492e94d0aa3160a41f8b8ca (patch) | |
tree | 0b9c554692352c7e16919a4358fc2a24fb0bdf4e /archaeological_operations/models.py | |
parent | cd9ce5447c7e0ba9c15b6711e29b1045101bd2b7 (diff) | |
download | Ishtar-e5252a6f73d073227492e94d0aa3160a41f8b8ca.tar.bz2 Ishtar-e5252a6f73d073227492e94d0aa3160a41f8b8ca.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) |