Exemplo n.º 1
0
def guard_send_to_lab(analysis_request):
    """ Guard for send_to_lab transition. Returns true if the current user is
    a client contact, the Sample (context) is active and it belongs to the same
    client.
    """
    if api.is_client_contact():
        user = api.get_current_user()
        client = analysis_request.getClient()
        if not client.getContactFromUsername(user.id):
            return False
    return True
Exemplo n.º 2
0
 def get_contact_name(self):
     user = api.get_current_user()
     contact = api.get_user_contact(user)
     return contact.getFullname()
Exemplo n.º 3
0
 def get_contact_title(self):
     user = api.get_current_user()
     contact = api.get_user_contact(user)
     return contact.getJobTitle()