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:02:19 +0000 (19:02 -0400)
Don't bother checking for user's blog if no user returned.

mediagoblin/media_types/blog/views.py

index 4b6ea7b718f782df4e9d4943531a962806b7ec90..9ca5518e6180e31dbb54345f274e6db004b21ecb 100644 (file)
@@ -360,7 +360,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)