Commit fad2dce266e58080b1c41a9dea3eb056b7dc7ddb
1 parent
b2ba9002
Exists in
master
and in
5 other branches
change success_url in update user
Showing
1 changed file
with
3 additions
and
2 deletions
Show diff stats
users/views.py
... | ... | @@ -107,7 +107,7 @@ class Profile(LoginRequiredMixin, generic.DetailView): |
107 | 107 | |
108 | 108 | class EditProfile(LoginRequiredMixin, generic.UpdateView): |
109 | 109 | |
110 | - login_url = reverse_lazy("core:home") | |
110 | + login_url = reverse_lazy('core:home') | |
111 | 111 | redirect_field_name = 'next' |
112 | 112 | template_name = 'users/edit_profile.html' |
113 | 113 | form_class = UserForm |
... | ... | @@ -135,11 +135,12 @@ class EditProfile(LoginRequiredMixin, generic.UpdateView): |
135 | 135 | |
136 | 136 | |
137 | 137 | class UpdateUser(LoginRequiredMixin, generic.edit.UpdateView): |
138 | + | |
138 | 139 | allowed_roles = ['student'] |
139 | 140 | login_url = reverse_lazy("core:home") |
140 | 141 | template_name = 'users/edit_profile.html' |
141 | 142 | form_class = UpdateUserForm |
142 | - success_url = reverse_lazy('app:index') | |
143 | + success_url = reverse_lazy('users:update_profile') | |
143 | 144 | |
144 | 145 | def get_object(self): |
145 | 146 | user = get_object_or_404(User, username = self.request.user.username) | ... | ... |