diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-06-30 17:26:44 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-06-30 17:26:44 +0200 |
commit | 726713f95f91fa83a8e1473625162ae831309952 (patch) | |
tree | 2b8ab152e92a95948e9a038ebcef815bfd56aa38 /archaeological_operations/models.py | |
parent | fd21739351daf697188329948492c65b1a9bd7e6 (diff) | |
parent | 483fcd46fb60a597959bfde9d00bde4cc1822cd2 (diff) | |
download | Ishtar-726713f95f91fa83a8e1473625162ae831309952.tar.bz2 Ishtar-726713f95f91fa83a8e1473625162ae831309952.zip |
Merge branch 'master' into develop
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r-- | archaeological_operations/models.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 1ebf462a3..b982e7d45 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -306,8 +306,8 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms, old_code = models.CharField(_(u"Old code"), max_length=200, null=True, blank=True) if settings.COUNTRY == 'fr': - code_patriarche = models.IntegerField(u"Code PATRIARCHE", null=True, - blank=True, unique=True) + code_patriarche = models.TextField(u"Code PATRIARCHE", null=True, + blank=True, unique=True) TABLE_COLS = ['full_code_patriarche'] + TABLE_COLS # preventive fnap_financing = models.FloatField(u"Financement FNAP (%)", @@ -548,7 +548,7 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms, def full_code_patriarche(self): if not self.code_patriarche: return '' - return settings.ISHTAR_OPE_PREFIX + unicode(self.code_patriarche) + return settings.ISHTAR_OPE_PREFIX + self.code_patriarche def clean(self): if not self.operation_code: @@ -783,6 +783,8 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms, self.year = self.start_date.year if self.operation_code is None: self.operation_code = self.get_available_operation_code(self.year) + if hasattr(self, 'code_patriarche'): + self.code_patriarche = self.code_patriarche or None return super(Operation, self).save(*args, **kwargs) |