You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hey, I have an author on my instance that gives an internal server error when I try to load their page - the relevant part of the stack trace seems to be:
File "/usr/local/lib/python3.9/site-packages/django/template/base.py", line 905, in render_annotated
return self.render(context)
File "/usr/local/lib/python3.9/site-packages/django/template/library.py", line 192, in render
output = self.func(*resolved_args, **resolved_kwargs)
File "/app/bookwyrm/templatetags/shelf_tags.py", line 40, in active_shelf
f"active_shelf-{user.id}-{book.id}",
AttributeError: 'NoneType' object has no attribute 'id'
I tried adding some early check/return in shelf_tags.py, but eventually I get another error instead, so now I'm giving up 😀
File "/usr/local/lib/python3.9/site-packages/django/template/defaulttags.py", line 449, in render
url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app)
File "/usr/local/lib/python3.9/site-packages/django/urls/base.py", line 86, in reverse
return resolver._reverse_with_prefix(view, prefix, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/urls/resolvers.py", line 698, in _reverse_with_prefix
raise NoReverseMatch(msg)
django.urls.exceptions.NoReverseMatch: Reverse for 'reading-status' with arguments '('want', '')' not found. 1 pattern(s) tried: ['reading-status/(?P<status>want|start|finish)/(?P<book_id>\\d+)/?$']
huh -- it sounds like there's a nonexistant book trying to display on the author page. It could be that there's a work with no editions 🤔
I'll try to dig through the db entries for the associated books and see if anything jumps out
I think models.Work.objects.filter(editions__isnull=True).count() will tell you if there are works without editions
I've been meaning to add some automated tasks that clean up book data that gets into a bad state. And I think I know how to resolve your author page error
I'm trying to replicate the error locally and works without editions don't seem to be the problem, so I'm still not sure what's up. Can you open a github issue for it?
Additional context:
The local author entry for the affected author:
Describe the bug
When loading certain author pages, e.g. https://reading.taks.garden/author/27 , Bookwyrm gives an internal server error.
Discussion from matrix:
Additional context:
The local author entry for the affected author:
The text was updated successfully, but these errors were encountered: