Add comment on dispatch

This commit is contained in:
zandercymatics 2024-05-14 13:33:07 -06:00
parent 059a99aca1
commit 54c532f3b2
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -108,7 +108,16 @@ class ContactProfileSetupView(ContactFormBaseView):
@waffle_flag('profile_feature')
@method_decorator(csrf_protect)
def dispatch(self, request, *args, **kwargs):
"""
Handles dispatching of the view, applying CSRF protection and checking the 'profile_feature' flag.
This method sets the redirect type based on the 'redirect' query parameter,
defaulting to BACK_TO_SELF if not provided.
It updates the session with the redirect view name if the redirect type is TO_SPECIFIC_PAGE.
Returns:
HttpResponse: The response generated by the parent class's dispatch method.
"""
# Default redirect type
default_redirect = self.RedirectType.BACK_TO_SELF