Disallow profile updating if user is checked in
It gives a flash and pops the user back to dashboard.
This commit is contained in:
parent
971cb5d12d
commit
5beafb2c6b
1 changed files with 8 additions and 0 deletions
8
vendor/registrasion/registrasion/views.py
vendored
8
vendor/registrasion/registrasion/views.py
vendored
|
@ -36,6 +36,7 @@ from django.http import Http404, HttpResponse
|
|||
from django.shortcuts import redirect
|
||||
from django.shortcuts import render
|
||||
from django.template import Context, Template, loader
|
||||
from django.urls import reverse
|
||||
import waffle
|
||||
|
||||
from lxml import etree
|
||||
|
@ -373,6 +374,13 @@ def edit_profile(request):
|
|||
|
||||
'''
|
||||
|
||||
if hasattr(request.user, "checkin"):
|
||||
if request.user.checkin.checked_in_bool:
|
||||
messages.add_message(
|
||||
request, messages.ERROR,
|
||||
'Profile cannot be edited as you have been checked in')
|
||||
return redirect(reverse('dashboard'))
|
||||
|
||||
form, handled = _handle_profile(request, "profile")
|
||||
|
||||
if handled and not form.errors:
|
||||
|
|
Loading…
Reference in a new issue