• jvoisin's avatar
    Declare variables before using them · bc876a15
    jvoisin authored
    It should fix the following stacktrace:
    
    ```
    [2021-02-18 14:46:14,771] ERROR {cps:1891} Exception on / [GET]
    Traceback (most recent call last):
      File "/opt/calibre/vendor/flask/app.py", line 2447, in wsgi_app
        response = self.full_dispatch_request()
      File "/opt/calibre/vendor/flask/app.py", line 1952, in full_dispatch_request
        rv = self.handle_user_exception(e)
      File "/opt/calibre/vendor/flask/app.py", line 1821, in handle_user_exception
        reraise(exc_type, exc_value, tb)
      File "/opt/calibre/vendor/flask/_compat.py", line 39, in reraise
        raise value
      File "/opt/calibre/vendor/flask/app.py", line 1950, in full_dispatch_request
        rv = self.dispatch_request()
      File "/opt/calibre/vendor/flask/app.py", line 1936, in dispatch_request
        return self.view_functions[rule.endpoint](**req.view_args)
      File "/opt/calibre/cps/usermanagement.py", line 38, in decorated_view
        return login_required(func)(*args, **kwargs)
      File "/opt/calibre/vendor/flask_login/utils.py", line 272, in decorated_view
        return func(*args, **kwargs)
      File "/opt/calibre/cps/web.py", line 719, in index
        return render_books_list("newest", sort_param, 1, page)
      File "/opt/calibre/cps/web.py", line 422, in render_books_list
        entries, random, pagination = calibre_db.fill_indexpage(page, 0, db.Books, True, order)
      File "/opt/calibre/cps/db.py", line 610, in fill_indexpage
        return self.fill_indexpage_with_archived_books(page, pagesize, database, db_filter, order, False, *join)
      File "/opt/calibre/cps/db.py", line 635, in fill_indexpage_with_archived_books
        #    book = self.order_authors(book)
    UnboundLocalError: local variable 'entries' referenced before assignment
    ```
    bc876a15
Name
Last commit
Last update
.github/ISSUE_TEMPLATE Loading commit data...
cps Loading commit data...
test Loading commit data...
.editorconfig Loading commit data...
.eslintrc Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE Loading commit data...
MANIFEST.in Loading commit data...
README.md Loading commit data...
babel.cfg Loading commit data...
cps.py Loading commit data...
messages.pot Loading commit data...
optional-requirements.txt Loading commit data...
requirements.txt Loading commit data...
setup.cfg Loading commit data...
setup.py Loading commit data...