Fix initializeMembers

This commit is contained in:
philipp lang 2022-01-11 02:37:53 +01:00
parent 5776c6c8fb
commit 63273015c7
1 changed files with 34 additions and 26 deletions

View File

@ -74,6 +74,7 @@ class InitializeMembers {
'version' => $member->version,
]);
try {
foreach ($this->api->coursesFor($member->id) as $course) {
$m->courses()->create([
'course_id' => Course::where('nami_id', $course->course_id)->firstOrFail()->id,
@ -83,7 +84,11 @@ class InitializeMembers {
'nami_id' => $course->id,
]);
}
} catch (RightException $e) {
}
try {
foreach ($this->api->membershipsOf($member->id) as $membership) {
if ($membership['entries_aktivBis'] !== '') {
continue;
@ -104,6 +109,9 @@ class InitializeMembers {
'subactivity_id' => $subactivityId,
]);
}
} catch (RightException $e) {
}
} catch (ModelNotFoundException $e) {
dd($e->getMessage(), $member);
}