diff options
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 |
commit | 6fd12a32ff6d3539c7d1b259ed0ce01d42117141 (patch) | |
tree | 0f6825eee3d3a9e1c9b809929b1e216cd7425b61 /archaeological_files/wizards.py | |
parent | 4eb2c3cf28eaf63b2e10d013d6c255844d46a4ff (diff) | |
download | Ishtar-6fd12a32ff6d3539c7d1b259ed0ce01d42117141.tar.bz2 Ishtar-6fd12a32ff6d3539c7d1b259ed0ce01d42117141.zip |
Add reminders for administrativ acts (refs #2060)
Diffstat (limited to 'archaeological_files/wizards.py')
-rw-r--r-- | archaeological_files/wizards.py | 24 |
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 |