Skip to content

Issue #228 warning if logged user has no worker associated.

Carlos Vega requested to merge feature/228_warning_user_without_worker into master

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

Merge request reports