Fix two crashes due to translations

This commit is contained in:
rubenwardy 2022-01-23 17:14:03 +00:00
parent deb5c02ce6
commit 390bf7a657
2 changed files with 4 additions and 1 deletions

View File

@ -140,7 +140,7 @@ def send_notification_digest(notifications: [Notification], locale):
return
with force_locale(locale or "en"):
msg = Message(gettext("%(num)d new notifications", len(notifications)), recipients=[user.email])
msg = Message(gettext("%(num)d new notifications", num=len(notifications)), recipients=[user.email])
msg.body = "".join(["<{}> {}\n{}: {}\n\n".format(notification.causer.display_name, notification.title, gettext("View"), abs_url(notification.url)) for notification in notifications])

View File

@ -45,6 +45,9 @@ def abs_url_samesite(path):
return urlunparse(base._replace(path=path))
def url_current(abs=False):
if request.args is None or request.view_args is None:
return None
args = MultiDict(request.args)
dargs = dict(args.lists())
dargs.update(request.view_args)