Skip to content

Commit

Permalink
fix: Fix admin pages for old games without classes too (#1555)
Browse files Browse the repository at this point in the history
* fix: Cater for old games without classes

* Merge branch 'development' into fix_admin_pages_pt2
  • Loading branch information
faucomte97 committed Jul 8, 2021
1 parent 7ebee03 commit ba65227
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aimmo/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ def players(self, obj):
return players

def school(self, obj):
return obj.game_class.teacher.school
if obj.game_class:
return obj.game_class.teacher.school
else:
return None


class AvatarDataAdmin(admin.ModelAdmin):
Expand Down

0 comments on commit ba65227

Please sign in to comment.