forked from DGNum/gestioCOF
ea81ab7b25
- Current day remains on the screen on history. - Message for generic team user connection is sended only if user is connecting from a k-fet url. - Less contrast on history.
18 lines
634 B
Python
18 lines
634 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from django.contrib import messages
|
|
from django.contrib.auth.signals import user_logged_in
|
|
from django.core.urlresolvers import reverse
|
|
from django.dispatch import receiver
|
|
|
|
|
|
@receiver(user_logged_in)
|
|
def messages_on_login(sender, request, user, **kwargs):
|
|
if (not user.username == 'kfet_genericteam' and
|
|
user.has_perm('kfet.is_team') and
|
|
'k-fet' in request.GET.get('next', '')):
|
|
messages.info(
|
|
request,
|
|
('<a href="{}">Connexion en utilisateur partagé ?</a>'
|
|
.format(reverse('kfet.login.genericteam'))),
|
|
extra_tags='safe')
|