django_microsoft_auth
django_microsoft_auth copied to clipboard
Create user with is_staff=True
Hello!
After the first login, the user logs into the admin. That is, the user is created with is_staff=True. It would have been very comfortable.
this is actually a solution that I did here - similar to what you asking
from django.db.models.signals import post_save, m2m_changed, post_delete
from django.dispatch import receiver
@receiver(post_save, sender=User)
def add_to_default_group(sender, **kwargs):
user = kwargs["instance"]
if kwargs["created"]:
user.is_staff = True
user.save()
@nabazm where we have to change, means which file we have to add the above code
Also, this package Authenticates only for Admin Login, how can we add this for our views,
@Sunag3 Please did you find a way to add it to the views? If so help!!