浏览代码

[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