Skip to content

Commit

Permalink
Resolve new User Accesses immediately, if possible (#3194)
Browse files Browse the repository at this point in the history
* use create fn to create Access objects

* case insensitive email match

* rm debug print statement
  • Loading branch information
timoballard authored Jan 12, 2024
1 parent 5435652 commit e7dc08e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/audit/models/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def create(self, **obj_data):
# try to pair this Access with an actual User object if we have one for this email address
if obj_data["email"]:
try:
acc_user = User.objects.get(email=obj_data["email"])
acc_user = User.objects.get(email__iexact=obj_data["email"])
# if we don't have a User for this email, leave it as None (unclaimed Access)
except User.DoesNotExist:
acc_user = None
Expand Down
2 changes: 1 addition & 1 deletion backend/audit/views/manage_submission_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _get_friendly_role(role):


def _create_and_save_access(sac, role, fullname, email):
Access(sac=sac, role=role, fullname=fullname, email=email).save()
Access.objects.create(sac=sac, role=role, fullname=fullname, email=email)


class ChangeAccessForm(forms.Form):
Expand Down

0 comments on commit e7dc08e

Please sign in to comment.