Explorar el Código

[scrobbles] Fix scrobble having no user in tests

Colin Powell hace 1 año
padre
commit
37da74708c
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      vrobbler/apps/scrobbles/models.py

+ 1 - 1
vrobbler/apps/scrobbles/models.py

@@ -560,7 +560,7 @@ class Scrobble(TimeStampedModel):
 
         if not self.timezone:
             timezone = settings.TIME_ZONE
-            if self.user.profile:
+            if self.user and self.user.profile:
                 timezone = self.user.profile.timezone
             self.timzeone = timezone