Fixed some logic holes

This commit is contained in:
2023-01-11 12:28:58 +01:00
parent dabfa2ecef
commit 92386ac8ce
4 changed files with 26 additions and 11 deletions

View File

@@ -281,10 +281,9 @@ class HoloUser():
"""Reset application of a user in tmp collection and replace it with an empty one
"""
if col_tmp.find_one({"user": self.id, "type": "application"}) is None:
col_tmp.insert_one(document=DefaultApplicationTemp(self.id).dict)
else:
col_tmp.delete_one({"user": self.id, "type": "application"})
col_tmp.insert_one(document=DefaultApplicationTemp(self.id, reapply=reapply).dict)
else:
col_tmp.find_one_and_replace({"user": self.id, "type": "application"}, DefaultApplicationTemp(self.id, reapply=reapply).dict)
async def application_next(self, query: str, msg: Message) -> None:
"""Move on filling application of user