diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-09-19 14:57:28 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-09-19 14:57:28 +0200 | 
| commit | 4f5423c36e7556d169562ea58e26fa260c91126a (patch) | |
| tree | 96049ec2e5681c9761c5e72accca556d7a42efb9 | |
| parent | fdd70f62447f8bba7fca85e8251d277ff3c81e1c (diff) | |
| download | Ishtar-4f5423c36e7556d169562ea58e26fa260c91126a.tar.bz2 Ishtar-4f5423c36e7556d169562ea58e26fa260c91126a.zip | |
Documents: fix new author shortcut
| -rw-r--r-- | ishtar_common/forms_common.py | 1 | ||||
| -rw-r--r-- | ishtar_common/models.py | 2 | ||||
| -rw-r--r-- | ishtar_common/views.py | 5 | 
3 files changed, 7 insertions, 1 deletions
| diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index d34c0d23f..b8272a9f3 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -1202,6 +1202,7 @@ class DocumentForm(forms.ModelForm, CustomForm, ManageOldType):      form_admin_name = _("Document - General")      form_slug = "document-general"      file_upload = True +    extra_form_modals = ["author", "person", "organization"]      associated_models = {'source_type': models.SourceType}      pk = forms.IntegerField(label="", required=False, widget=forms.HiddenInput) diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 2a50533db..cb1325af1 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2047,7 +2047,7 @@ class TemplateItem:              "models_treatments", "models")          if alt_model_name != model_name:              q |= Q(associated_model__klass=model_name, -              for_labels=True, available=True) +                   for_labels=True, available=True)          return DocumentTemplate.objects.filter(q)      @classmethod diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 33446ec8b..44831ba9f 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -1886,6 +1886,11 @@ class DocumentFormMixin(IshtarMixin, LoginRequiredMixin):      template_name = 'ishtar/forms/document.html'      model = models.Document +    def get_context_data(self, **kwargs): +        data = super(DocumentFormMixin, self).get_context_data(**kwargs) +        data["extra_form_modals"] = self.form_class.extra_form_modals +        return data +      def get_success_url(self):          return reverse("edit-document") + "?open_item={}".format(self.object.pk) | 
