File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
spiffworkflow-backend/src/spiffworkflow_backend/services Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,11 @@ def add_waiting_group_assignment(
157157 @classmethod
158158 def apply_waiting_group_assignments (cls , user : UserModel ) -> None :
159159 """Only called from create_user which is normally called at sign-in time"""
160- waiting = UserGroupAssignmentWaitingModel ().query .filter (UserGroupAssignmentWaitingModel .username == user .username ).all ()
160+ waiting = (
161+ UserGroupAssignmentWaitingModel ()
162+ .query .filter (UserGroupAssignmentWaitingModel .username .in_ ([user .username , user .email ])) # type: ignore
163+ .all ()
164+ )
161165 for assignment in waiting :
162166 cls .add_user_to_group (user , assignment .group )
163167 db .session .delete (assignment )
@@ -167,7 +171,9 @@ def apply_waiting_group_assignments(cls, user: UserModel) -> None:
167171 .all ()
168172 )
169173 for wildcard in wildcards :
170- if re .match (wildcard .pattern_from_wildcard_username (), user .username ):
174+ if re .match (wildcard .pattern_from_wildcard_username (), user .username ) or (
175+ user .email and re .match (wildcard .pattern_from_wildcard_username (), user .email )
176+ ):
171177 cls .add_user_to_group (user , wildcard .group )
172178 db .session .commit ()
173179
You can’t perform that action at this time.
0 commit comments