Preserve get params on invite send

This commit is contained in:
Mouse Reeve 2021-04-01 13:55:10 -07:00
parent b5e98e0bdf
commit 8039917b89
2 changed files with 10 additions and 5 deletions

View file

@ -57,7 +57,7 @@
{% endif %}
</td>
<td class="field is-grouped">
<form name="send-invite" method="post" action="{% url 'settings-invite-requests' %}">
<form name="send-invite" method="post">
{% csrf_token %}
<input type="hidden" name="invite-request" value="{{ req.id }}">
{% if not req.invite %}

View file

@ -1,9 +1,12 @@
""" invites when registration is closed """
from urllib.parse import urlencode
from django.contrib.auth.decorators import login_required, permission_required
from django.core.paginator import Paginator
from django.http import HttpResponseBadRequest
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.views import View
from django.views.decorators.http import require_POST
@ -98,9 +101,7 @@ class ManageInviteRequests(View):
sort = "-created_date"
paginated = Paginator(
models.InviteRequest.objects.filter(ignored=ignored).order_by(
sort
),
models.InviteRequest.objects.filter(ignored=ignored).order_by(sort),
PAGE_LENGTH,
)
@ -125,7 +126,11 @@ class ManageInviteRequests(View):
)
invite_request.save()
emailing.invite_email(invite_request)
return redirect("settings-invite-requests")
return redirect(
"{:s}?{:s}".format(
reverse("settings-invite-requests"), urlencode(request.GET.dict())
)
)
class InviteRequest(View):