diff --git a/gas/templates/gas/base_form.html b/gas/templates/gas/base_form.html index 6157ecf..24d21b2 100644 --- a/gas/templates/gas/base_form.html +++ b/gas/templates/gas/base_form.html @@ -4,7 +4,10 @@ {% load form_tags %} {% block content %} -
{% csrf_token %} + {% csrf_token %} {% if is_popup %} {% endif %} diff --git a/gas/views.py b/gas/views.py index 4dfa0aa..19f6721 100644 --- a/gas/views.py +++ b/gas/views.py @@ -201,6 +201,7 @@ class GASCreateView(GASMixin, CreateView): is_popup = "_popup" in self.request.GET ctx.update({ 'is_popup': is_popup, + 'form_id': 'main-form', }) return ctx @@ -220,6 +221,13 @@ class GASUpdateView(GASMixin, UpdateView): """ Same as Django's UpdateView, defined only for completeness. """ template_name = 'gas/base_form.html' + def get_context_data(self, **kwargs): + ctx = super().get_context_data(**kwargs) + ctx.update({ + 'form_id': 'main-form', + }) + return ctx + class GASDeleteView(GASMixin, DeleteView): template_name = "gas/delete_confirmation.html"