Skip to content
Snippets Groups Projects
Commit c43556f6 authored by Jean-Philippe Laverdure's avatar Jean-Philippe Laverdure
Browse files

Dev

parent 7fe4b60c
No related branches found
No related tags found
1 merge request!114Dev
...@@ -7,6 +7,7 @@ from django.db.models.signals import post_delete, post_save ...@@ -7,6 +7,7 @@ from django.db.models.signals import post_delete, post_save
from django.dispatch import receiver from django.dispatch import receiver
from django_auth_ldap.backend import LDAPBackend, populate_user from django_auth_ldap.backend import LDAPBackend, populate_user
from social_django.models import UserSocialAuth from social_django.models import UserSocialAuth
from django.conf import settings
from .models import Lab, Profile, ShareGroup from .models import Lab, Profile, ShareGroup
...@@ -42,6 +43,12 @@ def user_login(sender, user, **kwargs): ...@@ -42,6 +43,12 @@ def user_login(sender, user, **kwargs):
user.profile.labs.add(*Lab.objects.filter(ldap__in=user.ldap_user.group_names)) user.profile.labs.add(*Lab.objects.filter(ldap__in=user.ldap_user.group_names))
elif azuread_groups: elif azuread_groups:
user.profile.labs.add(*Lab.objects.filter(ldap__in=azuread_groups)) user.profile.labs.add(*Lab.objects.filter(ldap__in=azuread_groups))
if settings.AUTH_LDAP_STAFF_GROUP in azuread_groups:
user.is_staff = True
else:
user.is_staff = False
user.save()
user.profile.save() user.profile.save()
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</span> </span>
</a> </a>
<div class="collapse subnav {% if active_page == 'datafiles' or active_page == 'datasets' or active_page == 'shared-datafiles' or active_page == 'sharegroups' or active_page == 'dashboard' or active_page == 'api' %}show{% endif %}" id="file-subnav"> <div class="collapse subnav {% if active_page == 'datafiles' or active_page == 'datasets' or active_page == 'shared-datafiles' or active_page == 'sharegroups' or active_page == 'api' %}show{% endif %}" id="file-subnav">
<a class="nav-link {% if active_page == 'datafiles' %}active{% endif %}" href="{% url 'user.datafiles' %}"> <a class="nav-link {% if active_page == 'datafiles' %}active{% endif %}" href="{% url 'user.datafiles' %}">
<i class="fas fa-file-alt fa-fw fa-lg"></i> <i class="fas fa-file-alt fa-fw fa-lg"></i>
{% trans 'My Files' %} {% trans 'My Files' %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment