diff --git a/ordr2/templates/macros.jinja2 b/ordr2/templates/macros.jinja2
index 19720c3..42859f8 100644
--- a/ordr2/templates/macros.jinja2
+++ b/ordr2/templates/macros.jinja2
@@ -2,8 +2,10 @@
{% for queue in ('success', 'info', 'warning', 'error') %}
{% for message in request.session.pop_flash(queue) %}
{% set css_class = 'danger' if queue == 'error' else queue %}
-
-
+
+ {% if message.dismissable %}
+
+ {% endif %}
{{message.message|safe}}
{% if message.description %}
{{message.description|safe}}
diff --git a/ordr2/views/__init__.py b/ordr2/views/__init__.py
index 7e802be..f3335b7 100644
--- a/ordr2/views/__init__.py
+++ b/ordr2/views/__init__.py
@@ -1,12 +1,12 @@
from collections import namedtuple
-FlashMessage = namedtuple('FlashMessage', 'message description')
+FlashMessage = namedtuple('FlashMessage', 'message description dismissable')
-def flash(request, channel, message, description=''):
+def flash(request, channel, message, description='', dismissable=True):
''' small wrapper around request.session.flash '''
- msg = FlashMessage(message=message, description=description)
+ msg = FlashMessage(message, description, dismissable)
request.session.flash(msg, channel, allow_duplicate=False)
diff --git a/ordr2/views/account.py b/ordr2/views/account.py
index 8a4d900..ff579cd 100644
--- a/ordr2/views/account.py
+++ b/ordr2/views/account.py
@@ -39,7 +39,14 @@ def login(context, request):
headers=headers
)
- #request.session.flash(MSG_LOGIN_ERROR.format(url), 'error')
+ request.flash(
+ 'error',
+ 'Oh snap! You entered the wrong unsername and/or password.',
+ '''Please try it again. If you still can not log in make sure that
+ your account is activated and you haven't enabled caps lock on
+ your keyboard.''',
+ dismissable=False
+ )
return HTTPFound(request.resource_path(context, 'login'))