diff --git a/wildlifecompliance/helpers.py b/wildlifecompliance/helpers.py index 0483f48fa..837fb7042 100644 --- a/wildlifecompliance/helpers.py +++ b/wildlifecompliance/helpers.py @@ -61,24 +61,23 @@ def belongs_to_list(user, group_names): return user.groups.filter(name__in=group_names).exists() -def is_model_backend(request): - # Return True if user logged in via single sign-on (i.e. an internal) - logger.debug( - 'helpers.is_model_backend(): {0}'.format( - request.session.get('_auth_user_backend') - )) - return 'ModelBackend' in request.session.get('_auth_user_backend') +#def is_model_backend(request): +# # Return True if user logged in via single sign-on (i.e. an internal) +# logger.debug( +# 'helpers.is_model_backend(): {0}'.format( +# request.session.get('_auth_user_backend') +# )) +# return 'ModelBackend' in request.session.get('_auth_user_backend') -def is_email_auth_backend(request): - # Return True if user logged in via social_auth (i.e. an external user - # signing in with a login-token) - return 'EmailAuth' in request.session.get('_auth_user_backend') +#def is_email_auth_backend(request): +# # Return True if user logged in via social_auth (i.e. an external user +# # signing in with a login-token) +# return 'EmailAuth' in request.session.get('_auth_user_backend') def is_wildlifecompliance_admin(request): return request.user.is_authenticated() and \ - is_model_backend(request) and \ in_dbca_domain(request) and \ ( request.user.has_perm('wildlifecompliance.system_administrator') or @@ -100,7 +99,6 @@ def is_wildlifecompliance_payment_officer(request): PAYMENTS_GROUP_NAME = 'Wildlife Compliance - Payment Officers' is_payment_officer = request.user.is_authenticated() and \ - is_model_backend(request) and \ in_dbca_domain(request) and \ ( request.user.groups.filter(name__in=[PAYMENTS_GROUP_NAME]).exists() @@ -125,7 +123,7 @@ def in_dbca_domain(request): def is_departmentUser(request): return request.user.is_authenticated() and ( - ((is_model_backend(request) or settings.ALLOW_EMAIL_ADMINS) and in_dbca_domain(request)) or + (settings.ALLOW_EMAIL_ADMINS and in_dbca_domain(request)) or is_compliance_management_approved_external_user(request) ) @@ -146,7 +144,8 @@ def is_reception(request): def is_customer(request): - return request.user.is_authenticated() and is_email_auth_backend(request) + #return request.user.is_authenticated() and is_email_auth_backend(request) + return request.user.is_authenticated() and not request.user.is_staff def is_internal(request): diff --git a/wildlifecompliance/templates/wildlifecompliance/index.html b/wildlifecompliance/templates/wildlifecompliance/index.html index 932eeb56f..4f5b850a5 100644 --- a/wildlifecompliance/templates/wildlifecompliance/index.html +++ b/wildlifecompliance/templates/wildlifecompliance/index.html @@ -35,14 +35,7 @@
Submit your email to login or start the new-user registration process.
+ LoginAt the Department of Biodiversity, Conservation and Attractions, we employ a password-less authentication system, meaning you never need to remember a password. When you need to login to a site, such as Wildlife Licensing, simply enter your email and an - authentication link will be sent to your registered email address. From there, simply follow the link to complete the login process. + authentication code will be sent to your registered email address. From there, enter the code on screen to complete the login process.
{% endif %} diff --git a/wildlifecompliance/views.py b/wildlifecompliance/views.py index 1965136fb..0f888b0f0 100644 --- a/wildlifecompliance/views.py +++ b/wildlifecompliance/views.py @@ -10,7 +10,7 @@ from datetime import datetime, timedelta -from wildlifecompliance.helpers import is_internal, prefer_compliance_management, is_model_backend, in_dbca_domain, \ +from wildlifecompliance.helpers import is_internal, prefer_compliance_management, in_dbca_domain, \ is_compliance_internal_user, is_wildlifecompliance_admin, is_compliance_management_callemail_readonly_user, belongs_to, \ is_compliance_management_approved_external_user, is_customer from wildlifecompliance.forms import * @@ -374,4 +374,4 @@ def getPrivateFile(request): return HttpResponse(the_data, content_type=mimetypes.types_map['.'+str(extension)]) - return HttpResponse() \ No newline at end of file + return HttpResponse()