core: fix error when checking generated users with no expiry

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-04-10 17:53:46 +02:00
parent f977bf61eb
commit cca33a74b6
1 changed files with 1 additions and 1 deletions

View File

@ -60,7 +60,7 @@ def clean_temporary_users(self: MonitoredTask):
messages = []
deleted_users = 0
for user in User.objects.filter(**{f"attributes__{USER_ATTRIBUTE_GENERATED}": True}):
if USER_ATTRIBUTE_EXPIRES not in user.attributes:
if not user.attributes.get(USER_ATTRIBUTE_EXPIRES):
continue
delta: timedelta = _now - datetime.fromtimestamp(
user.attributes.get(USER_ATTRIBUTE_EXPIRES)