minor fix
This commit is contained in:
parent
8c6d56b27c
commit
6e82a2cf88
2 changed files with 5 additions and 8 deletions
|
@ -15,11 +15,10 @@ class COFCASBackend(CASBackend):
|
|||
return username.strip().lower()
|
||||
|
||||
def configure_user(self, user):
|
||||
# cannot use "defaults" arg
|
||||
profile, _ = CofProfile.objects.get_or_create(user=user)
|
||||
profile.login_clipper = user.username
|
||||
profile.save()
|
||||
user.email = settings.CAS_EMAIL_FORMAT % profile.login_clipper
|
||||
clipper = user.username
|
||||
user.profile.login_clipper = clipper
|
||||
user.profile.save()
|
||||
user.email = settings.CAS_EMAIL_FORMAT % clipper
|
||||
user.save()
|
||||
return user
|
||||
|
||||
|
|
|
@ -58,9 +58,8 @@ from kfet.statistic import ScaleMixin, last_stats_manifest, tot_ventes, WeekScal
|
|||
@teamkfet_required
|
||||
def login_genericteam(request):
|
||||
# Check si besoin de déconnecter l'utilisateur de CAS
|
||||
profile = getattr(request.user, 'profile', None)
|
||||
cas_logout = None
|
||||
if profile and profile.login_clipper:
|
||||
if request.user.profile.login_clipper:
|
||||
# Récupèration de la vue de déconnexion de CAS
|
||||
# Ici, car request sera modifié après
|
||||
next_page = request.META.get('HTTP_REFERER', None)
|
||||
|
@ -2030,7 +2029,6 @@ def order_to_inventory(request, pk):
|
|||
messages.success(request, "C'est tout bon !")
|
||||
return redirect('kfet.order')
|
||||
else:
|
||||
print(formset.errors)
|
||||
messages.error(request, "Corrigez les erreurs")
|
||||
else:
|
||||
formset = cls_formset(initial=initial)
|
||||
|
|
Loading…
Reference in a new issue