mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
remove duplications
This commit is contained in:
parent
15dc01a910
commit
2a9b54f32f
@ -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):
|
||||||
|
Loading…
Reference in New Issue
Block a user