diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-08-25 13:39:11 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-08-25 13:39:11 +0200 |
commit | d92a620ab273cc4569b5bad71aeb59957b4804e6 (patch) | |
tree | a257ee17dbc673bbd045e5559144d40d37b6b244 | |
parent | 6e16f2c830c9dae4450609d66b8b46a091976099 (diff) | |
download | Ishtar-d92a620ab273cc4569b5bad71aeb59957b4804e6.tar.bz2 Ishtar-d92a620ab273cc4569b5bad71aeb59957b4804e6.zip |
Fix conversion to string for display of OA number (refs #1317)
-rw-r--r-- | archaeological_context_records/models.py | 2 | ||||
-rw-r--r-- | archaeological_finds/models.py | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index c6d8ec023..57c95c3b6 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -155,7 +155,7 @@ class ContextRecord(BaseHistorizedItem, OwnPerms): def _real_label(self): if not self.operation.code_patriarche: return - return settings.JOINT.join((self.operation.code_patriarche, + return settings.JOINT.join((unicode(self.operation.code_patriarche), self.label)) def _temp_label(self): diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index b5a13868d..4b1e95e34 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -77,7 +77,7 @@ class BaseFind(BaseHistorizedItem, OwnPerms): return find = self.get_last_find() ope = self.context_record.operation - c_id = [ope.code_patriarche or \ + c_id = [unicode(ope.code_patriarche) or \ (unicode(ope.year) + "-" + unicode(ope.operation_code))] c_id.append(find and find.material_type.code or '') c_id.append(self.context_record.label) @@ -90,7 +90,7 @@ class BaseFind(BaseHistorizedItem, OwnPerms): return find = self.get_last_find() ope = self.context_record.operation - c_id = [ope.code_patriarche or \ + c_id = [unicode(ope.code_patriarche) or \ (unicode(ope.year) + "-" + unicode(ope.operation_code))] c_id.append(unicode(self.index)) return settings.JOINT.join(c_id) @@ -120,9 +120,7 @@ class BaseFind(BaseHistorizedItem, OwnPerms): lbl) if it]) def _temp_label(self): - if not self.context_record.parcel \ - or not self.context_record.operation \ - or not self.context_record.operation.code_patriarche: + if not self.context_record.parcel: return find = self.get_last_find() lbl = find.label or self.label |