summaryrefslogtreecommitdiff
path: root/archaeological_files/wizards.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2014-10-13 01:22:50 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2014-10-13 01:22:50 +0200
commitfc4248a63aef13c8c7144a412bf52640432eed72 (patch)
tree0f6825eee3d3a9e1c9b809929b1e216cd7425b61 /archaeological_files/wizards.py
parentadd5a8d76c65530806c35d11b723c8f6be350b5f (diff)
downloadIshtar-fc4248a63aef13c8c7144a412bf52640432eed72.tar.bz2
Ishtar-fc4248a63aef13c8c7144a412bf52640432eed72.zip
Add reminders for administrativ acts (refs #2060)
Diffstat (limited to 'archaeological_files/wizards.py')
-rw-r--r--archaeological_files/wizards.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/archaeological_files/wizards.py b/archaeological_files/wizards.py
index 7fb654b0b..4ad947641 100644
--- a/archaeological_files/wizards.py
+++ b/archaeological_files/wizards.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Copyright (C) 2012-2013 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
+# Copyright (C) 2012-2014 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -155,6 +155,28 @@ class FileDeletionWizard(FileClosingWizard):
class FileAdministrativeActWizard(OperationAdministrativeActWizard):
model = models.File
+ def get_reminder(self):
+ form_key = 'selec-' + self.url_name
+ if self.url_name.endswith('_administrativeactfile'):
+ # modification and deletion are suffixed with '_modification'
+ # and '_deletion' so it is creation
+ file_id = self.session_get_value(form_key, "pk")
+ try:
+ return ((_(u"Archaelogical file"),
+ unicode(models.File.objects.get(pk=file_id))),)
+ except models.File.DoesNotExist:
+ return
+ else:
+ admin_id = self.session_get_value(form_key, "pk")
+ try:
+ admin = AdministrativeAct.objects.get(pk=admin_id)
+ if not admin.associated_file:
+ return
+ return ((_(u"Archaelogical file"),
+ unicode(admin.associated_file)),)
+ except AdministrativeAct.DoesNotExist:
+ return
+
class FileEditAdministrativeActWizard(FileAdministrativeActWizard):
model = AdministrativeAct
edit = True