core: fix condition in task clean_expiring_models (cherry-pick #9603) (#9604)

core: fix condition in task clean_expiring_models (#9603)

Co-authored-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
gcp-cherry-pick-bot[bot]
2024-05-06 14:36:42 +02:00
committed by GitHub
parent 225d02d02d
commit 23bbb6e5ef

View File

@ -55,7 +55,7 @@ def clean_expired_models(self: SystemTask):
session.delete() session.delete()
amount += 1 amount += 1
case "db": case "db":
if ( if not (
DBSessionStore.get_model_class() DBSessionStore.get_model_class()
.objects.filter(session_key=session.session_key, expire_date__gt=now()) .objects.filter(session_key=session.session_key, expire_date__gt=now())
.exists() .exists()