Issue #228 warning if logged user has no worker associated.
See issue #228 (closed)
Change log:
AdminLTE.css: changed CSS stuff to style new class .no_worker_warning _base.html: changed header to show a warning message.
worker.py
@staticmethod
def get_details(the_user):
persons = Worker.objects.filter(user=the_user)
if len(persons) == 0:
return the_user.get_full_name(), '<No worker information>'
else:
person = persons[0]
role = "N/A"
if person.roles.filter(study=GLOBAL_STUDY_ID).count() > 0:
- role = person.roles.filter(study=GLOBAL_STUDY_ID)[0].get_role_display()
+ role = person.role
return unicode(person), role
Edited by Carlos Vega