Skip to content

Commit

Permalink
Add applicant gp to user created with built in get_or_create
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepsajan0 committed Jun 17, 2023
1 parent 5dfc7b4 commit 043c9a1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hypha/apply/funds/models/submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,11 @@ def ensure_user_has_account(self):
email=email,
defaults={'full_name': full_name}
)
# :todo: check for the applicant group in get_or_create.
# Ensure applying user should have applicant role
applicant_group = Group.objects.get(name=APPLICANT_GROUP_NAME)
if applicant_group not in self.user.groups.all():
self.user.groups.add(applicant_group)
self.user.save()
else:
self.user, _ = User.objects.get_or_create_and_notify(
email=email,
Expand Down

0 comments on commit 043c9a1

Please sign in to comment.