skip command if settings do not exist (#30284)

This commit is contained in:
Frédéric Péters 2019-02-04 06:28:46 +01:00
parent 5ba59b3c75
commit 7467c3dfb9
1 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,8 @@ class Command(BaseCommand):
return requests.get(url, headers={'Accept': 'application/json'})
def handle(self, *args, **kwargs):
if not getattr(settings, 'ENCOMBRANTS_FORM_URL', None):
return
if datetime.today().weekday() in (5, 6):
# we don't notify during the weekend
return