Skip to content

Commit 243d1fa

Browse files
committed
Don't try to post to social if no providers at all are configured
1 parent 1cdeed4 commit 243d1fa

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pgweb/news/management/commands/social_post.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ class Command(BaseCommand):
2424
help = 'Post to social media'
2525

2626
def handle(self, *args, **options):
27+
if not allprovidernames:
28+
# If we have no providers, there is no posting
29+
return
30+
2731
curs = connection.cursor()
2832
curs.execute("SELECT pg_try_advisory_lock(62387372)")
2933
if not curs.fetchall()[0][0]:

0 commit comments

Comments
 (0)