Commit 1926d59e65f81a8acf2ce45b28616e28c8bcffa8
1 parent
a3ff98ef
Exists in
master
and in
5 other branches
Edit user test views and url #7
Showing
2 changed files
with
3 additions
and
2 deletions
Show diff stats
users/urls.py
@@ -10,5 +10,5 @@ urlpatterns = [ | @@ -10,5 +10,5 @@ urlpatterns = [ | ||
10 | url(r'^profile/$', views.Profile.as_view(), name='profile'), | 10 | url(r'^profile/$', views.Profile.as_view(), name='profile'), |
11 | url(r'^profile/editar/(?P<username>[\w_-]+)/$', views.EditProfile.as_view(), name='edit_profile'), | 11 | url(r'^profile/editar/(?P<username>[\w_-]+)/$', views.EditProfile.as_view(), name='edit_profile'), |
12 | # | 12 | # |
13 | - url(r'^profile/update/$', views.UpdateUser.as_view(), name='update_user'), | 13 | + url(r'^profile/update/$', views.UpdateUser.as_view(), name='update_profile'), |
14 | ] | 14 | ] |
users/views.py
@@ -133,10 +133,11 @@ class EditProfile(LoginRequiredMixin, generic.UpdateView): | @@ -133,10 +133,11 @@ class EditProfile(LoginRequiredMixin, generic.UpdateView): | ||
133 | 133 | ||
134 | return super(EditProfile, self).form_valid(form) | 134 | return super(EditProfile, self).form_valid(form) |
135 | 135 | ||
136 | + | ||
136 | class UpdateUser(LoginRequiredMixin, generic.edit.UpdateView): | 137 | class UpdateUser(LoginRequiredMixin, generic.edit.UpdateView): |
137 | allowed_roles = ['student'] | 138 | allowed_roles = ['student'] |
138 | login_url = reverse_lazy("core:home") | 139 | login_url = reverse_lazy("core:home") |
139 | - # template_name = 'users/edit_profile.html' | 140 | + template_name = 'users/edit_profile.html' |
140 | form_class = UpdateUserForm | 141 | form_class = UpdateUserForm |
141 | success_url = reverse_lazy('app:index') | 142 | success_url = reverse_lazy('app:index') |
142 | 143 |