20 lines
499 B
Python
20 lines
499 B
Python
from django.contrib.auth.models import AbstractUser, Group
|
|
from django.db import models
|
|
|
|
from django_scim.models import AbstractSCIMUserMixin, AbstractSCIMGroupMixin
|
|
|
|
class Group(AbstractSCIMGroupMixin, Group):
|
|
def __str__(self) -> str:
|
|
return self.scim_display_name
|
|
|
|
|
|
class User(AbstractSCIMUserMixin, AbstractUser):
|
|
groups = models.ManyToManyField(Group)
|
|
|
|
@property
|
|
def scim_groups(self):
|
|
return self.groups
|
|
|
|
def __str__(self) -> str:
|
|
return self.email
|