Преглед изворни кода

[scrobbles] Fix scrobble having no user in tests

Colin Powell пре 1 година
родитељ
комит
37da74708c
1 измењених фајлова са 1 додато и 1 уклоњено
  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