Fix server crash on blog about page [#5572]
authorAndrew Browning <ayleph@thisshitistemp.com>
Sun, 8 Jul 2018 23:00:52 +0000 (19:00 -0400)
committerAndrew Browning <ayleph@thisshitistemp.com>
Sun, 8 Jul 2018 23:01:07 +0000 (19:01 -0400)
Don't bother checking for user's blog if no user returned.

mediagoblin/media_types/blog/views.py

index f1d5c49de00f6f2109b2748eba9b677c72268c2e..2bf2e5be67eda19607ebb23e8d631337eb1c4fcc 100644 (file)
@@ -376,7 +376,9 @@ def blog_about_view(request):
     user = request.db.LocalUser.query.filter(
         LocalUser.username==url_user
     ).first()
-    blog = get_blog_by_slug(request, blog_slug, author=user.id)
+
+    if user:
+        blog = get_blog_by_slug(request, blog_slug, author=user.id)
 
     if not user or not blog:
         return render_404(request)