Skip to content

Commit 7f8a0a5

Browse files
committed
Load signal handlers from an app instead of urllist
This is the place to load them to make sure they always load. This means we can also now remove a hardcoded special varnish purging in the CVE crawler script, because all saves including those from cron jobs will now fire the signals and thus the automatic varnish purges.
1 parent 95e4ef5 commit 7f8a0a5

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

pgweb/core/apps.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from django.apps import AppConfig, apps
2+
3+
4+
class CoreAppConfig(AppConfig):
5+
name = 'pgweb.core'
6+
7+
def ready(self):
8+
from pgweb.util.signals import register_basic_signal_handlers
9+
10+
register_basic_signal_handlers()

pgweb/security/management/commands/update_cve_links.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,3 @@ def handle(self, *args, **options):
3939
4040
{0}
4141
""".format("\n".join(newly_visible)))
42-
list(map(varnish_purge, SecurityPatch.purge_urls))

pgweb/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
'django.contrib.admin',
9797
'django_markwhat',
9898
'django.contrib.staticfiles',
99-
'pgweb.core',
99+
'pgweb.core.apps.CoreAppConfig',
100100
'pgweb.mailqueue',
101101
'pgweb.account',
102102
'pgweb.news',

pgweb/urls.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from django.conf.urls import include, url
22
from django.views.generic import RedirectView
33

4-
from pgweb.util.signals import register_basic_signal_handlers
5-
64
import pgweb.contributors.views
75
import pgweb.core.views
86
import pgweb.docs.views
@@ -28,9 +26,6 @@
2826
from django.contrib import admin
2927
admin.autodiscover()
3028

31-
# Register our save signal handlers
32-
register_basic_signal_handlers()
33-
3429
urlpatterns = [
3530
url(r'^$', pgweb.core.views.home),
3631
url(r'^dyncss/(?P<css>base|docs).css$', pgweb.core.views.dynamic_css),

0 commit comments

Comments
 (0)