@@ -53,7 +53,6 @@ class User(PermissionsMixin, AbstractBaseUser, AbstractBaseModel):
53
53
username = models .CharField (
54
54
"Username" , max_length = 255 , unique = True , validators = [username_validator ]
55
55
)
56
- is_active = models .BooleanField ("Active" , default = True )
57
56
58
57
# Cognito-user related fields #
59
58
# some additional fields which will be filled-out only for users
@@ -62,26 +61,31 @@ class User(PermissionsMixin, AbstractBaseUser, AbstractBaseModel):
62
61
63
62
# Django-user related fields #
64
63
# password is inherited from AbstractBaseUser
65
- email = models .EmailField ("Email address" , blank = True ) # allow non-unique emails
64
+ email_intake = models .EmailField ("Email address" , blank = True ) # allow non-unique emails
66
65
is_staff = models .BooleanField (
67
66
"staff status" ,
68
67
default = False ,
69
68
help_text = "Designates whether the user can log into this admin site." ,
70
69
)
71
70
72
- first_name = models .CharField (max_length = 255 , blank = True )
73
- last_name = models .CharField (max_length = 255 , blank = True )
74
- gmail = models .EmailField (blank = True )
75
- preferred_email = models .EmailField (blank = True )
71
+ name_first = models .CharField (max_length = 255 , blank = True )
72
+ name_last = models .CharField (max_length = 255 , blank = True )
73
+ email_gmail = models .EmailField (blank = True )
74
+ email_preferred = models .EmailField (blank = True )
75
+ email_cognito = models .EmailField (blank = True )
76
76
77
77
user_status = models .ForeignKey (
78
78
"UserStatusType" , null = True , on_delete = models .PROTECT
79
79
)
80
80
# current_practice_area = models.ManyToManyField("PracticeArea")
81
81
# target_practice_area = models.ManyToManyField("PracticeArea")
82
+ practice_area_primary = models .ManyToManyField ("PracticeArea" , related_name = "primary_users" )
83
+ practice_area_secondary = models .ManyToManyField ("PracticeArea" , related_name = "secondary_users" )
84
+ practice_area_target_intake = models .ManyToManyField ("PracticeArea" , related_name = "target_intake_users" )
82
85
83
- current_job_title = models .CharField (max_length = 255 , blank = True )
84
- target_job_title = models .CharField (max_length = 255 , blank = True )
86
+
87
+ job_title_current_intake = models .CharField (max_length = 255 , blank = True )
88
+ job_title_target_intake = models .CharField (max_length = 255 , blank = True )
85
89
current_skills = models .CharField (max_length = 255 , blank = True )
86
90
target_skills = models .CharField (max_length = 255 , blank = True )
87
91
@@ -105,15 +109,15 @@ class User(PermissionsMixin, AbstractBaseUser, AbstractBaseModel):
105
109
objects = UserManager ()
106
110
107
111
USERNAME_FIELD = "username"
108
- EMAIL_FIELD = "preferred_email "
109
- REQUIRED_FIELDS = ["email " ] # used only on createsuperuser
112
+ EMAIL_FIELD = "email_preferred "
113
+ REQUIRED_FIELDS = ["email_intake " ] # used only on createsuperuser
110
114
111
115
@property
112
116
def is_django_user (self ):
113
117
return self .has_usable_password ()
114
118
115
119
def __str__ (self ):
116
- return f"{ self .email } "
120
+ return f"{ self .email_intake } "
117
121
118
122
119
123
class Project (AbstractBaseModel ):
0 commit comments