mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-24 19:48:36 +02:00
changes
This commit is contained in:
parent
963edc1c05
commit
cb771f6208
2 changed files with 18 additions and 17 deletions
|
@ -12,6 +12,7 @@ from .domain import (
|
||||||
DomainUsersView,
|
DomainUsersView,
|
||||||
DomainAddUserView,
|
DomainAddUserView,
|
||||||
DomainInvitationDeleteView,
|
DomainInvitationDeleteView,
|
||||||
|
DomainInvitationCancelView,
|
||||||
DomainDeleteUserView,
|
DomainDeleteUserView,
|
||||||
)
|
)
|
||||||
from .user_profile import UserProfileView, FinishProfileSetupView
|
from .user_profile import UserProfileView, FinishProfileSetupView
|
||||||
|
|
|
@ -1054,26 +1054,26 @@ class DomainAddUserView(DomainFormBaseView):
|
||||||
# # The order of the superclasses matters here. BaseDeleteView has a bug where the
|
# # The order of the superclasses matters here. BaseDeleteView has a bug where the
|
||||||
# # "form_valid" function does not call super, so it cannot use SuccessMessageMixin.
|
# # "form_valid" function does not call super, so it cannot use SuccessMessageMixin.
|
||||||
# # The workaround is to use SuccessMessageMixin first.
|
# # The workaround is to use SuccessMessageMixin first.
|
||||||
# class DomainInvitationDeleteView(SuccessMessageMixin, DomainInvitationPermissionDeleteView):
|
class DomainInvitationDeleteView(SuccessMessageMixin, DomainInvitationPermissionDeleteView):
|
||||||
# object: DomainInvitation # workaround for type mismatch in DeleteView
|
object: DomainInvitation # workaround for type mismatch in DeleteView
|
||||||
|
|
||||||
# def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
# """Override post method in order to error in the case when the
|
"""Override post method in order to error in the case when the
|
||||||
# domain invitation status is RETRIEVED"""
|
domain invitation status is RETRIEVED"""
|
||||||
# self.object = self.get_object()
|
self.object = self.get_object()
|
||||||
# form = self.get_form()
|
form = self.get_form()
|
||||||
# if form.is_valid() and self.object.status == self.object.DomainInvitationStatus.INVITED:
|
if form.is_valid() and self.object.status == self.object.DomainInvitationStatus.INVITED:
|
||||||
# return self.form_valid(form)
|
return self.form_valid(form)
|
||||||
# else:
|
else:
|
||||||
# # Produce an error message if the domain invatation status is RETRIEVED
|
# Produce an error message if the domain invatation status is RETRIEVED
|
||||||
# messages.error(request, f"Invitation to {self.object.email} has already been retrieved.")
|
messages.error(request, f"Invitation to {self.object.email} has already been retrieved.")
|
||||||
# return HttpResponseRedirect(self.get_success_url())
|
return HttpResponseRedirect(self.get_success_url())
|
||||||
|
|
||||||
# def get_success_url(self):
|
def get_success_url(self):
|
||||||
# return reverse("domain-users", kwargs={"pk": self.object.domain.id})
|
return reverse("domain-users", kwargs={"pk": self.object.domain.id})
|
||||||
|
|
||||||
# def get_success_message(self, cleaned_data):
|
def get_success_message(self, cleaned_data):
|
||||||
# return f"Canceled invitation to {self.object.email}."
|
return f"Canceled invitation to {self.object.email}."
|
||||||
|
|
||||||
|
|
||||||
class DomainInvitationCancelView(SuccessMessageMixin, DomainInvitationUpdateView):
|
class DomainInvitationCancelView(SuccessMessageMixin, DomainInvitationUpdateView):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue