diff --git a/combo/apps/wcs/models.py b/combo/apps/wcs/models.py index ff425ba3..613f054c 100644 --- a/combo/apps/wcs/models.py +++ b/combo/apps/wcs/models.py @@ -18,7 +18,6 @@ import collections import copy import logging -import urllib.parse from django.conf import settings from django.contrib.postgres.fields import JSONField @@ -139,20 +138,20 @@ class WcsFormCell(CellBase): populate_cache() def get_cell_extra_context(self, context): - request = context.get('request') - context = super().get_cell_extra_context(context) - context['slug'] = self.formdef_reference.split(':')[-1] - context['title'] = self.cached_title - context['url'] = self.cached_url - if not is_a_bot(request): - context['url'] += 'tryauth?cancelurl=%s' % urllib.parse.quote(request.build_absolute_uri()) + extra_context = super().get_cell_extra_context(context) + extra_context['slug'] = self.formdef_reference.split(':')[-1] + extra_context['title'] = self.cached_title + extra_context['url'] = self.cached_url + extra_context['request_is_a_bot'] = is_a_bot(context.get('request')) + extra_context['is_form'] = True + if self.cached_json: - context['description'] = mark_safe(self.cached_json.get('description', '')) - context['css_classes'] = get_formdef_css_classes(self.cached_json) + extra_context['description'] = mark_safe(self.cached_json.get('description', '')) + extra_context['css_classes'] = get_formdef_css_classes(self.cached_json) for attribute in self.cached_json: if attribute not in context: - context[attribute] = self.cached_json.get(attribute) - return context + extra_context[attribute] = self.cached_json.get(attribute) + return extra_context def get_additional_label(self): if not self.cached_title: diff --git a/combo/apps/wcs/templates/combo/wcs/form.html b/combo/apps/wcs/templates/combo/wcs/form.html index a70c5f22..ccbc67cb 100644 --- a/combo/apps/wcs/templates/combo/wcs/form.html +++ b/combo/apps/wcs/templates/combo/wcs/form.html @@ -1,9 +1,5 @@ {% block cell-content %} -