Skip to content

Commit

Permalink
ref(compliance): Allow failure on terms_accepted signal
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer committed Feb 15, 2018
1 parent f425c63 commit f0fb315
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/sentry/api/endpoints/organization_index.py
Expand Up @@ -250,13 +250,6 @@ def post(self, request):
actor_id=request.user.id if request.user.is_authenticated() else None
)

if result.get('agreeTerms'):
terms_accepted.send(
user=request.user,
organization=org,
sender=type(self),
)

except IntegrityError:
return Response(
{
Expand All @@ -265,5 +258,13 @@ def post(self, request):
status=409,
)

# failure on sending this signal is acceptable
if result.get('agreeTerms'):
terms_accepted.send_robust(
user=request.user,
organization=org,
sender=type(self),
)

return Response(serialize(org, request.user), status=201)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)

0 comments on commit f0fb315

Please sign in to comment.