summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_treatments.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/models_treatments.py')
-rw-r--r--archaeological_finds/models_treatments.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py
index 8fcf37b9c..5dacb72f8 100644
--- a/archaeological_finds/models_treatments.py
+++ b/archaeological_finds/models_treatments.py
@@ -27,7 +27,7 @@ from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _, ugettext
-from ishtar_common.utils import cached_label_changed
+from ishtar_common.utils import cached_label_changed, get_current_year
from ishtar_common.models import GeneralType, ImageModel, BaseHistorizedItem, \
OwnPerms, HistoricalRecords, Person, Organization, Source, \
ValueGetter, post_save_cache, ShortMenuItem, DashboardFormItem
@@ -100,8 +100,7 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem,
max_length=200)
other_reference = models.CharField(_(u"Other ref."), blank=True, null=True,
max_length=200)
- year = models.IntegerField(_(u"Year"),
- default=lambda: datetime.datetime.now().year)
+ year = models.IntegerField(_(u"Year"), default=get_current_year)
index = models.IntegerField(_(u"Index"), default=1)
file = models.ForeignKey(
'TreatmentFile', related_name='treatments', blank=True, null=True,
@@ -480,8 +479,7 @@ class TreatmentFile(DashboardFormItem, ClosedItem, BaseHistorizedItem,
SLUG = 'treatmentfile'
# fields
- year = models.IntegerField(_(u"Year"),
- default=lambda: datetime.datetime.now().year)
+ year = models.IntegerField(_(u"Year"), default=get_current_year)
index = models.IntegerField(_(u"Index"), default=1)
internal_reference = models.CharField(_(u"Internal reference"), blank=True,
null=True, max_length=200)