mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-24 15:01:35 +01:00
Fix two crashes due to translations
This commit is contained in:
parent
deb5c02ce6
commit
390bf7a657
@ -140,7 +140,7 @@ def send_notification_digest(notifications: [Notification], locale):
|
|||||||
return
|
return
|
||||||
|
|
||||||
with force_locale(locale or "en"):
|
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])
|
msg.body = "".join(["<{}> {}\n{}: {}\n\n".format(notification.causer.display_name, notification.title, gettext("View"), abs_url(notification.url)) for notification in notifications])
|
||||||
|
|
||||||
|
@ -45,6 +45,9 @@ def abs_url_samesite(path):
|
|||||||
return urlunparse(base._replace(path=path))
|
return urlunparse(base._replace(path=path))
|
||||||
|
|
||||||
def url_current(abs=False):
|
def url_current(abs=False):
|
||||||
|
if request.args is None or request.view_args is None:
|
||||||
|
return None
|
||||||
|
|
||||||
args = MultiDict(request.args)
|
args = MultiDict(request.args)
|
||||||
dargs = dict(args.lists())
|
dargs = dict(args.lists())
|
||||||
dargs.update(request.view_args)
|
dargs.update(request.view_args)
|
||||||
|
Loading…
Reference in New Issue
Block a user