remove duplications

This commit is contained in:
Matthias 2021-09-03 00:55:08 +02:00
parent 15dc01a910
commit 2a9b54f32f
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -827,37 +827,34 @@ class SettingsView(TemplateView):
return ctx return ctx
class CustomEmailView(LoginRequiredMixin, EmailView): class AllauthOverrides(LoginRequiredMixin):
"""
Override allauths views to always redirect to success_url
"""
def get(self, request, *args, **kwargs):
# always redirect to settings
return HttpResponseRedirect(self.success_url)
class CustomEmailView(AllauthOverrides, EmailView):
""" """
Override of allauths EmailView to always show the settings but leave the functions allow Override of allauths EmailView to always show the settings but leave the functions allow
""" """
success_url = reverse_lazy("settings") success_url = reverse_lazy("settings")
def get(self, request, *args, **kwargs):
# always redirect to settings
return HttpResponseRedirect(self.success_url)
class CustomConnectionsView(AllauthOverrides, ConnectionsView):
class CustomConnectionsView(LoginRequiredMixin, ConnectionsView):
""" """
Override of allauths ConnectionsView to always show the settings but leave the functions allow Override of allauths ConnectionsView to always show the settings but leave the functions allow
""" """
success_url = reverse_lazy("settings") success_url = reverse_lazy("settings")
def get(self, request, *args, **kwargs):
# always redirect to settings
return HttpResponseRedirect(self.success_url)
class CustomPasswordChangeView(LoginRequiredMixin, PasswordChangeView): class CustomPasswordChangeView(LoginRequiredMixin, PasswordChangeView):
""" """
Override of allauths PasswordChangeView to always show the settings but leave the functions allow Override of allauths PasswordChangeView to always show the settings but leave the functions allow
""" """
success_url = reverse_lazy("settings") success_url = reverse_lazy("login")
def get(self, request, *args, **kwargs):
# always redirect to settings
return HttpResponseRedirect(self.success_url)
class CurrencyRefreshView(RedirectView): class CurrencyRefreshView(RedirectView):