From 55b5365862511080a4b26d3c6e3f9012c0f74cff Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson <frjo@xdeb.org> Date: Wed, 27 Nov 2019 12:41:17 +0100 Subject: [PATCH] Use set_urlconf() to set urlconf sice we not are in a proper request. --- .../apply/projects/management/commands/notify_report_due.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opentech/apply/projects/management/commands/notify_report_due.py b/opentech/apply/projects/management/commands/notify_report_due.py index 242eb3bcd..7f0c290cf 100644 --- a/opentech/apply/projects/management/commands/notify_report_due.py +++ b/opentech/apply/projects/management/commands/notify_report_due.py @@ -5,7 +5,7 @@ from django.contrib.messages.storage.fallback import FallbackStorage from django.core.management.base import BaseCommand from django.http import HttpRequest from django.utils import timezone - +from django.urls import set_urlconf from opentech.apply.activity.messaging import MESSAGES, messenger from opentech.apply.home.models import ApplyHomePage from opentech.apply.projects.models import Project @@ -19,6 +19,7 @@ class Command(BaseCommand): def handle(self, *args, **options): site = ApplyHomePage.objects.first().get_site() + set_urlconf('opentech.apply.urls') # Mock a HTTPRequest in order to pass the site settings into the # templates -- GitLab