diff --git a/hc/accounts/views.py b/hc/accounts/views.py index 5d5d4db4..f600d6a1 100644 --- a/hc/accounts/views.py +++ b/hc/accounts/views.py @@ -237,6 +237,12 @@ def notifications(request): _ensure_own_team(request) profile = request.profile + ctx = { + "status": "default", + "page": "profile", + "profile": profile + } + if request.method == "POST": form = ReportSettingsForm(request.POST) if form.is_valid(): @@ -257,12 +263,7 @@ def notifications(request): profile.next_nag_date = None profile.save() - messages.success(request, "Your settings have been updated!") - - ctx = { - "page": "profile", - "profile": profile, - } + ctx["status"] = "info" return render(request, "accounts/notifications.html", ctx) diff --git a/templates/accounts/badges.html b/templates/accounts/badges.html index f0019dd0..58a78be2 100644 --- a/templates/accounts/badges.html +++ b/templates/accounts/badges.html @@ -13,7 +13,7 @@
diff --git a/templates/accounts/notifications.html b/templates/accounts/notifications.html index 2d1958bf..f6c8f58a 100644 --- a/templates/accounts/notifications.html +++ b/templates/accounts/notifications.html @@ -8,13 +8,6 @@

Settings

- {% if messages %} -
- {% for message in messages %} -

{{ message }}

- {% endfor %} -
- {% endif %}
@@ -27,7 +20,7 @@
-
+
{% csrf_token %} @@ -91,6 +84,11 @@ class="btn btn-default pull-right">Save Changes
+ {% if status == "info" %} + + {% endif %}