appsv2: fix funky current_version not being defined when hydrating pre-upgrade notifications

This commit is contained in:
Alexandre Aubin 2023-05-13 19:07:34 +02:00
parent 7eb10c3729
commit 8fa823b414

View file

@ -3130,7 +3130,7 @@ def _notification_is_dismissed(name, settings):
def _filter_and_hydrate_notifications(notifications, current_version=None, data={}):
def is_version_more_recent_than_current_version(name):
def is_version_more_recent_than_current_version(name, current_version):
current_version = str(current_version)
# Boring code to handle the fact that "0.1 < 9999~ynh1" is False
@ -3145,7 +3145,7 @@ def _filter_and_hydrate_notifications(notifications, current_version=None, data=
for name, content_per_lang in notifications.items()
if current_version is None
or name == "main"
or is_version_more_recent_than_current_version(name)
or is_version_more_recent_than_current_version(name, current_version)
}