dont run _create_post if no file orgy

pull/216/head
Aevann 2023-11-03 00:06:55 +03:00
parent 45568afdb6
commit 14dcbb100d
1 changed files with 3 additions and 0 deletions

View File

@ -138,6 +138,9 @@ def get_names():
return ' and '.join([x[0] for x in g.db.query(Orgy.title).filter_by(type='file').order_by(Orgy.start_utc).limit(2)])
def _create_post(title, body, pin_hours):
if not g.db.query(Orgy).filter_by(type='file').first():
return
_delete_all_posts()
title += f': {get_names()}'