mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
patch email-endpoint to use settings view
This commit is contained in:
parent
1772348d36
commit
566257881d
@ -37,7 +37,7 @@ from rest_framework.documentation import include_docs_urls
|
||||
|
||||
from .views import auth_request
|
||||
from .views import IndexView, SearchView, DatabaseStatsView
|
||||
from .views import SettingsView, EditUserView, SetPasswordView
|
||||
from .views import SettingsView, EditUserView, SetPasswordView, CustomEmailView
|
||||
from .views import CurrencyRefreshView
|
||||
from .views import AppearanceSelectView, SettingCategorySelectView
|
||||
from .views import DynamicJsView
|
||||
@ -160,7 +160,11 @@ urlpatterns = [
|
||||
url(r'^api-doc/', include_docs_urls(title='InvenTree API')),
|
||||
|
||||
url(r'^markdownx/', include('markdownx.urls')),
|
||||
url(r'^accounts/', include('allauth.urls')), # SSO
|
||||
|
||||
# Single Sign On / allauth
|
||||
# overrides of urlpatterns
|
||||
url(r'^accounts/email/', CustomEmailView.as_view(), name='account_email'),
|
||||
url(r'^accounts/', include('allauth.urls')), # included urlpatterns
|
||||
]
|
||||
|
||||
# Server running in "DEBUG" mode?
|
||||
|
@ -812,6 +812,16 @@ class SettingsView(TemplateView):
|
||||
|
||||
return ctx
|
||||
|
||||
class CustomEmailView(LoginRequiredMixin, EmailView):
|
||||
"""
|
||||
Override of allauths EmailView to always show the settings but leave the functions allow
|
||||
"""
|
||||
success_url = reverse_lazy("settings")
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
# always redirect to settings
|
||||
return HttpResponseRedirect(self.success_url)
|
||||
|
||||
|
||||
class CurrencyRefreshView(RedirectView):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user