Commit 292168a1 authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Add message when saving pref

parent 134fefe9
import logging
from datetime import datetime
from django.db import router
from django import forms
......@@ -15,6 +16,7 @@ from django.forms import widgets
from django.http import HttpResponseForbidden
from django.shortcuts import render, redirect
from django.template import TemplateDoesNotExist
from django.template.defaultfilters import time as time_filter
from django.urls import reverse
from django.utils.encoding import force_bytes, force_text
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
......@@ -232,6 +234,10 @@ def account_detail(request):
)(instance=pref, data=request.POST if is_posted else None)
if is_posted and form_prefs.is_valid():
form_prefs.save()
messages.success(
request=request,
message=ugettext("Preferences successfully saved on %s") % time_filter(datetime.now()),
)
return redirect(reverse("basetheme_bootstrap:account"))
# dirty patch for time field (don't know why django doesn't express the correct type by default)
for f in form_prefs.fields.values():
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment