@@ -313,7 +313,9 @@ def teacher(self):
313
313
# pylint: disable-next=import-outside-toplevel
314
314
from .teacher import SchoolTeacher , teacher_as_type
315
315
316
- return teacher_as_type (super ().teacher , SchoolTeacher )
316
+ teacher = super ().teacher
317
+
318
+ return teacher_as_type (teacher , SchoolTeacher ) if teacher else None
317
319
318
320
319
321
# pylint: disable-next=missing-class-docstring,too-few-public-methods
@@ -341,7 +343,9 @@ def teacher(self):
341
343
# pylint: disable-next=import-outside-toplevel
342
344
from .teacher import AdminSchoolTeacher , teacher_as_type
343
345
344
- return teacher_as_type (super ().teacher , AdminSchoolTeacher )
346
+ teacher = super ().teacher
347
+
348
+ return teacher_as_type (teacher , AdminSchoolTeacher ) if teacher else None
345
349
346
350
347
351
# pylint: disable-next=missing-class-docstring,too-few-public-methods
@@ -369,7 +373,11 @@ def teacher(self):
369
373
# pylint: disable-next=import-outside-toplevel
370
374
from .teacher import NonAdminSchoolTeacher , teacher_as_type
371
375
372
- return teacher_as_type (super ().teacher , NonAdminSchoolTeacher )
376
+ teacher = super ().teacher
377
+
378
+ return (
379
+ teacher_as_type (teacher , NonAdminSchoolTeacher ) if teacher else None
380
+ )
373
381
374
382
375
383
# pylint: disable-next=missing-class-docstring,too-few-public-methods
@@ -395,7 +403,9 @@ def teacher(self):
395
403
# pylint: disable-next=import-outside-toplevel
396
404
from .teacher import NonSchoolTeacher , teacher_as_type
397
405
398
- return teacher_as_type (super ().teacher , NonSchoolTeacher )
406
+ teacher = super ().teacher
407
+
408
+ return teacher_as_type (teacher , NonSchoolTeacher ) if teacher else None
399
409
400
410
401
411
# pylint: disable-next=missing-class-docstring,too-few-public-methods
0 commit comments