From 7d91f9e8a46f32255ec00ae49e26efd0b521f3c4 Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Sat, 10 Oct 2020 12:14:02 -0500 Subject: [PATCH] Check if `primary_location` is null in Player.json() --- GeoffreyApp/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GeoffreyApp/models.py b/GeoffreyApp/models.py index 9d72c59..067a98a 100644 --- a/GeoffreyApp/models.py +++ b/GeoffreyApp/models.py @@ -113,7 +113,7 @@ class Player(models.Model): return {"name": self.name, "mc_uuid": self.mc_uuid, "discord_uuid": self.discord_uuid, - "primary_location": self.primary_location.id + "primary_location": None if self.primary_location is None else self.primary_location.id } @property