summaryrefslogtreecommitdiff
path: root/archaeological_context_records/models.py
diff options
context:
space:
mode:
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
commit4ccbb4bef309571159c9558cca5da04987a68646 (patch)
tree3bedb956e0505accf622a6c42c94f3e613286bd6 /archaeological_context_records/models.py
parent39e0c9cf302f8b468e116047eef18f42d712166e (diff)
downloadIshtar-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.py5
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