Skip to content

Commit

Permalink
Check that teacher exists in ID webhook (#1065)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad authored Jan 10, 2024
1 parent 90dfd6a commit 049a84e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ IDistributedLockProvider distributedLockProvider
Contact.Fields.dfeta_LastIdentityUpdate
});

if (teacher is null)
{
throw new InvalidOperationException($"Received a webhook for a teacher that doesn't exist: {user.Trn}.");
}

if (notification.TimeUtc > (teacher.dfeta_LastIdentityUpdate ?? DateTime.MinValue))
{
await dataverseAdapter.UpdateTeacherIdentityInfo(new UpdateTeacherIdentityInfoCommand()
Expand Down

0 comments on commit 049a84e

Please sign in to comment.