diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-10-22 00:08:24 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-10-22 00:08:24 +0200 |
commit | 4ccbb4bef309571159c9558cca5da04987a68646 (patch) | |
tree | 3bedb956e0505accf622a6c42c94f3e613286bd6 /archaeological_context_records/models.py | |
parent | 39e0c9cf302f8b468e116047eef18f42d712166e (diff) | |
download | Ishtar-4ccbb4bef309571159c9558cca5da04987a68646.tar.bz2 Ishtar-4ccbb4bef309571159c9558cca5da04987a68646.zip |
Djangoization - Major refactoring (step 15)
* works on dashboards
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r-- | archaeological_context_records/models.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 64772627b..c558587aa 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -169,8 +169,9 @@ class ContextRecord(BaseHistorizedItem, OwnPerms): def get_years(cls): years = set() for res in list(cls.objects.values('operation__start_date')): - yr = res['operation__start_date'].year - years.add(yr) + if res['operation__start_date']: + yr = res['operation__start_date'].year + years.add(yr) return list(years) @classmethod |