Add UserDomainRole table and helpers

This commit is contained in:
Neil Martinsen-Burrell 2023-03-06 12:03:29 -06:00
parent 22eb49c004
commit 49b4f078e8
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184
9 changed files with 211 additions and 7 deletions

View file

@ -1,4 +1,5 @@
from django.contrib.auth.models import AbstractUser
from django.db import models
class User(AbstractUser):
@ -7,6 +8,12 @@ class User(AbstractUser):
but can be customized later.
"""
domains = models.ManyToManyField(
"registrar.Domain",
through="registrar.UserDomainRole",
related_name="users",
)
def __str__(self):
# this info is pulled from Login.gov
if self.first_name or self.last_name: