diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-11-12 16:18:57 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-11-12 16:18:57 +0100 |
commit | f1dc9dbfed7cc90899f9975c29091a61e63fcb02 (patch) | |
tree | d7f34f347aa533855990da473b17fc35f5bb1878 /archaeological_operations | |
parent | ce0947a6b35bb0ef3a12fe6c07efaa074317fe4b (diff) | |
download | Ishtar-f1dc9dbfed7cc90899f9975c29091a61e63fcb02.tar.bz2 Ishtar-f1dc9dbfed7cc90899f9975c29091a61e63fcb02.zip |
Fix pin and unpi for administrativ acts
Diffstat (limited to 'archaeological_operations')
-rw-r--r-- | archaeological_operations/forms.py | 3 | ||||
-rw-r--r-- | archaeological_operations/models.py | 2 | ||||
-rw-r--r-- | archaeological_operations/wizards.py | 9 |
3 files changed, 11 insertions, 3 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index a8c827757..082b63593 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -1394,7 +1394,8 @@ class AdministrativeActOpeSelect(TableSelect): search_vector = forms.CharField( label=_(u"Full text search"), widget=widgets.SearchWidget( - 'archaeological-operations', 'administrativeact' + 'archaeological-operations', 'administrativeact', + 'administrativeactop', )) year = forms.IntegerField(label=_("Year")) index = forms.IntegerField(label=_("Index")) diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 56af40ba0..ae9c221c4 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -1639,11 +1639,13 @@ class AdministrativeAct(BaseHistorizedItem, OwnPerms, ValueGetter): 'treatment_file__type__label__iexact' ), } + for v in ALT_NAMES.values(): for language_code, language_lbl in settings.LANGUAGES: activate(language_code) EXTRA_REQUEST_KEYS[unicode(v[0])] = v[1] deactivate() + UP_MODEL_QUERY = {} POST_PROCESS_REQUEST = { 'operation__towns__numero_insee__startswith': '_get_department_code', diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py index b0708f2db..de38beb95 100644 --- a/archaeological_operations/wizards.py +++ b/archaeological_operations/wizards.py @@ -395,8 +395,13 @@ class OperationAdministrativeActWizard(OperationWizard): dct['redirect'] = reverse('generatedoc-administrativeactop', args=[admact.pk, r[0]]) # make the new object a default - self.request.session[self.current_obj_slug] = unicode(admact.pk) - self.request.session[self.get_object_name(admact)] = unicode(admact.pk) + ishtaruser = self.request.user.ishtaruser \ + if hasattr(self.request.user, 'ishtaruser') else None + if ishtaruser and ishtaruser.current_profile \ + and ishtaruser.current_profile.auto_pin: + self.request.session[self.current_obj_slug] = unicode(admact.pk) + self.request.session[self.get_object_name(admact)] = unicode( + admact.pk) res = render(self.request, 'ishtar/wizard/wizard_done.html', dct) return res |