development branch created to preserve working deploy project
This commit is contained in:
+6
-4
@@ -1,5 +1,5 @@
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.views import LoginView
|
||||
from django.contrib.auth.views import LoginView, PasswordChangeView
|
||||
from django.http import HttpResponseForbidden, JsonResponse
|
||||
from django.shortcuts import render
|
||||
from django.urls import reverse_lazy
|
||||
@@ -192,7 +192,9 @@ class UserActiveView(LoginRequiredMixin, View):
|
||||
return JsonResponse({'success': True, 'is_active': target_user.is_active})
|
||||
|
||||
|
||||
class UserChangePasswordView(LoginRequiredMixin, View):
|
||||
class CustomPasswordChangeView(PasswordChangeView):
|
||||
template_name = 'registration/change_password.html'
|
||||
form_class = UserChangePasswordForm
|
||||
success_url = reverse_lazy('home')
|
||||
|
||||
def get_success_url(self):
|
||||
next_url = self.request.GET.get('next') or self.request.POST.get('next')
|
||||
return next_url or reverse_lazy('dashboard')
|
||||
Reference in New Issue
Block a user