diff --git a/cps/opds.py b/cps/opds.py index c66ee836..e8d3fad9 100644 --- a/cps/opds.py +++ b/cps/opds.py @@ -94,7 +94,7 @@ def feed_cc_search(query): @opds.route("/opds/search", methods=["GET"]) @requires_basic_auth_if_no_ano def feed_normal_search(): - return feed_search(request.args.get("query").strip()) + return feed_search(request.args.get("query", "").strip()) @opds.route("/opds/new") diff --git a/cps/tasks/mail.py b/cps/tasks/mail.py index c1def491..6aa18fde 100644 --- a/cps/tasks/mail.py +++ b/cps/tasks/mail.py @@ -172,6 +172,7 @@ class TaskEmail(CalibreTask): log.debug_or_exception(e) self._handleError(u'MemoryError sending email: ' + str(e)) except (smtplib.SMTPException, smtplib.SMTPAuthenticationError) as e: + log.debug_or_exception(e) if hasattr(e, "smtp_error"): text = e.smtp_error.decode('utf-8').replace("\n", '. ') elif hasattr(e, "message"): @@ -179,10 +180,10 @@ class TaskEmail(CalibreTask): elif hasattr(e, "args"): text = '\n'.join(e.args) else: - log.debug_or_exception(e) text = '' self._handleError(u'Smtplib Error sending email: ' + text) except (socket.error) as e: + log.debug_or_exception(e) self._handleError(u'Socket Error sending email: ' + e.strerror) diff --git a/cps/templates/feed.xml b/cps/templates/feed.xml index 4b65b1ca..4ad1db8c 100644 --- a/cps/templates/feed.xml +++ b/cps/templates/feed.xml @@ -11,18 +11,18 @@ -{% if pagination.has_prev %} +{% if pagination and pagination.has_prev %} {% endif %} -{% if pagination.has_next %} +{% if pagination and pagination.has_next %} {% endif %} -{% if pagination.has_prev %} +{% if pagination and pagination.has_prev %} @@ -30,7 +30,7 @@ - +