Skip to content

Commit

Permalink
Merge pull request #155 from dimagi/ce/repeater-fixes
Browse files Browse the repository at this point in the history
repeater fixes
  • Loading branch information
calellowitz authored Oct 5, 2023
2 parents 6662581 + b41487c commit 1273cec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions commcare_connect/opportunity/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def post(self, *args, **kwargs):
user_created = create_hq_user(self.request.user, domain, opportunity.api_key)
if not user_created:
return Response("Failed to create user", status=400)
ConnectIDUserLink.objects.create(
commcare_username=self.request.user.username.lower(), user=self.request.user, domain=domain
)
cc_username = f"{self.request.user.username.lower()}@{domain}.commcarehq.org"
ConnectIDUserLink.objects.create(commcare_username=cc_username, user=self.request.user, domain=domain)
return Response(status=201)
5 changes: 2 additions & 3 deletions commcare_connect/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ 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.lower(), user=request.user, domain=domain
)
cc_username = f"{request.user.username.lower()}@{domain}.commcarehq.org"
ConnectIDUserLink.objects.create(commcare_username=cc_username, user=request.user, domain=domain)
try:
access_object = OpportunityAccess.objects.get(user=request.user, opportunity=opportunity)
except OpportunityAccess.DoesNotExist:
Expand Down
1 change: 1 addition & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
CONNECTID_CLIENT_SECRET = env("cid_client_secret", default="")

OAUTH2_PROVIDER = {
"ACCESS_TOKEN_EXPIRE_SECONDS": "1209600", # seconds in two weeks
"RESOURCE_SERVER_INTROSPECTION_URL": f"{CONNECTID_URL}/o/introspect/",
"RESOURCE_SERVER_INTROSPECTION_CREDENTIALS": (
CONNECTID_CLIENT_ID,
Expand Down

0 comments on commit 1273cec

Please sign in to comment.