Parcourir la source

[scrobbles] Fix scrobble having no user in tests

Colin Powell il y a 1 an
Parent
commit
37da74708c
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  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