Skip to content

Commit

Permalink
Merge pull request #140 from dimagi/ce/lower-user
Browse files Browse the repository at this point in the history
use lowered usernames to match hq
  • Loading branch information
calellowitz authored Oct 3, 2023
2 parents f708f0c + 457d5fc commit 84c08c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion commcare_connect/opportunity/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ def post(self, *args, **kwargs):
if not user_created:
return Response("Failed to create user", status=400)
ConnectIDUserLink.objects.create(
commcare_username=self.request.user.username, user=self.request.user, domain=domain
commcare_username=self.request.user.username.lower(), user=self.request.user, domain=domain
)
return Response(status=201)
4 changes: 3 additions & 1 deletion commcare_connect/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ def start_learn_app(request):
user_created = create_hq_user(request.user, domain, api_key)
if not user_created:
return HttpResponse("Failed to create user", status=400)
ConnectIDUserLink.objects.create(commcare_username=request.user.username, user=request.user, domain=domain)
ConnectIDUserLink.objects.create(
commcare_username=request.user.username.lower(), user=request.user, domain=domain
)
try:
access_object = OpportunityAccess.objects.get(user=request.user, opportunity=opportunity)
except OpportunityAccess.DoesNotExist:
Expand Down

0 comments on commit 84c08c3

Please sign in to comment.