From 59ece469a53cbadae7ceedc83db89ebf9a42ea13 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Thu, 29 Oct 2020 01:13:02 -0700 Subject: [PATCH] add another db toggle for discord --- suchwow/app.py | 2 +- suchwow/models.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/suchwow/app.py b/suchwow/app.py index 0a513cc..a25d262 100644 --- a/suchwow/app.py +++ b/suchwow/app.py @@ -72,7 +72,7 @@ def create_accounts(): @app.cli.command("post_new_memes") def post_new_memes(): # run every 5 mins - all_posts = Post.select().order_by(Post.timestamp.desc()).where(Post.to_reddit == False) + all_posts = Post.select().order_by(Post.timestamp.desc()).where(Post.to_reddit == False, Post.to_discord == False) for post in all_posts: diff = datetime.now() - post.timestamp recent_post = diff < timedelta(hours=2) diff --git a/suchwow/models.py b/suchwow/models.py index 02bfb3d..3fb6b91 100644 --- a/suchwow/models.py +++ b/suchwow/models.py @@ -18,6 +18,7 @@ class Post(Model): timestamp = DateTimeField(default=datetime.now) reddit_url = CharField(null=True) to_reddit = BooleanField(default=False) + to_discord = BooleanField(default=False) class Meta: database = db