Skip to content

Commit

Permalink
fix: catch trying to sync non-user records
Browse files Browse the repository at this point in the history
  • Loading branch information
themightychris committed Sep 6, 2023
1 parent d337960 commit 4c0ae96
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions php-classes/Slate/Connectors/AbstractSpreadsheetConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,14 @@ public static function pullStudents(IJob $Job, SpreadsheetReader $spreadsheet, $

// apply values from spreadsheet
try {
if (!$Record->isA(User::class)) {
throw new RemoteRecordInvalid(
'not-a-user',
sprintf('Matched student to record %s from row #%u, but record class is not user or student...refusing to promote automatically', $Record->getTitle(), $results['analyzed']),
$row
);
}

static::_applyStudentUserChanges($Job, $Record, $row, $results);
} catch (RemoteRecordInvalid $e) {
if ($e->getValueKey()) {
Expand Down

0 comments on commit 4c0ae96

Please sign in to comment.