Skip to content
Snippets Groups Projects
Commit c9b0c3bb authored by Todd Dembrey's avatar Todd Dembrey
Browse files

GH-858: Make sure we redirect the user back to same page (inc q strings)

parent b639e56e
No related branches found
No related tags found
No related merge requests found
...@@ -73,4 +73,4 @@ class CommentFormView(DelegatedViewMixin, CreateView): ...@@ -73,4 +73,4 @@ class CommentFormView(DelegatedViewMixin, CreateView):
@classmethod @classmethod
def contribute_form(cls, instance, user): def contribute_form(cls, instance, user):
# We dont want to pass the submission as the instance # We dont want to pass the submission as the instance
return super().contribute_form(None, user=user) return super().contribute_form(instance=None, user=user)
...@@ -134,7 +134,10 @@ class DelegatedViewMixin(View): ...@@ -134,7 +134,10 @@ class DelegatedViewMixin(View):
return cls.context_name, form return cls.context_name, form
def get_success_url(self): def get_success_url(self):
return self.request.path query = self.request.GET.urlencode()
if query:
query = '?' + query
return self.request.path + query
class CreateOrUpdateView(SingleObjectTemplateResponseMixin, ModelFormMixin, ProcessFormView): class CreateOrUpdateView(SingleObjectTemplateResponseMixin, ModelFormMixin, ProcessFormView):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment