Commit cdd0662c by Kálmán Viktor

dashboard: edit user preferences

parent 33262020
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
{% if profile.profile.use_gravatar %}checked="checked"{% endif %} {% if profile.profile.use_gravatar %}checked="checked"{% endif %}
type="checkbox"/> <a href="https://gravatar.com">What's Gravatar?</a> type="checkbox"/> <a href="https://gravatar.com">What's Gravatar?</a>
</p> </p>
<a href="{% url "dashboard.views.profile-preferences" %}">Change password or language</a>
{% endif %} {% endif %}
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
......
...@@ -133,6 +133,8 @@ urlpatterns = patterns( ...@@ -133,6 +133,8 @@ urlpatterns = patterns(
url(r'^interface/(?P<pk>\d+)/delete/$', InterfaceDeleteView.as_view(), url(r'^interface/(?P<pk>\d+)/delete/$', InterfaceDeleteView.as_view(),
name="dashboard.views.interface-delete"), name="dashboard.views.interface-delete"),
url(r'^profile/$', MyPreferencesView.as_view(),
name="dashboard.views.profile-preferences"),
url(r'^profile/(?P<pk>\d+)/$', ProfileView.as_view(), url(r'^profile/(?P<pk>\d+)/$', ProfileView.as_view(),
name="dashboard.views.profile"), name="dashboard.views.profile"),
url(r'^profile/(?P<pk>\d+)/use_gravatar/$', toggle_use_gravatar), url(r'^profile/(?P<pk>\d+)/use_gravatar/$', toggle_use_gravatar),
......
...@@ -2462,7 +2462,7 @@ class MyPreferencesView(UpdateView): ...@@ -2462,7 +2462,7 @@ class MyPreferencesView(UpdateView):
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
self.ojbect = self.get_object() self.ojbect = self.get_object()
redirect_response = HttpResponseRedirect( redirect_response = HttpResponseRedirect(
reverse("dashboard.views.profile")) reverse("dashboard.views.profile-preferences"))
if "preferred_language" in request.POST: if "preferred_language" in request.POST:
form = MyProfileForm(request.POST, instance=self.get_object()) form = MyProfileForm(request.POST, instance=self.get_object())
if form.is_valid(): if form.is_valid():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment