From be8181ec42b6b9fb4aa064169ffc5f43f8e4ad3a Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 21 Oct 2017 17:02:24 +0200 Subject: [PATCH] Add _messages template to hosting/settings.html --- hosting/templates/hosting/settings.html | 1 + hosting/views.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/hosting/templates/hosting/settings.html b/hosting/templates/hosting/settings.html index 971f6d9d..93e31d5d 100644 --- a/hosting/templates/hosting/settings.html +++ b/hosting/templates/hosting/settings.html @@ -7,6 +7,7 @@ {% block content %}
+ {% include 'hosting/includes/_messages.html' %}

{% trans "My Settings" %}

diff --git a/hosting/views.py b/hosting/views.py index 22c5b35e..f6043b87 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -635,6 +635,10 @@ class SettingsView(LoginRequiredMixin, FormView): exp_year=card_details_response['exp_year'], card_id=card_details_response['card_id'] ) + msg = _( + "Successfully associated the card with your account" + ) + messages.add_message(request, messages.SUCCESS, msg) return self.render_to_response(self.get_context_data()) else: return self.form_invalid(form)