Skip to content

Commit

Permalink
Adding isactive check to webhook router
Browse files Browse the repository at this point in the history
  • Loading branch information
voynow committed Oct 14, 2024
1 parent b5d8960 commit 618c1bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/webhook_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ def _handle_request(event: dict, invocation_id: str) -> dict:

if event_type == "activity":
if aspect_type == "create":
return handle_activity_create(user, event, invocation_id)
if user.is_active:
return handle_activity_create(user, event, invocation_id)
else:
return {
"success": True,
"message": f"Activity {event.get('object_id')} created, but user is inactive",
}
if aspect_type in {"update", "delete"}:
return {
"success": True,
Expand Down

0 comments on commit 618c1bd

Please sign in to comment.