# HG changeset patch # User Brian Neal # Date 1428369250 18000 # Node ID 886234943aedf896f0d084a4f658aa5339a72758 # Parent 0365fdbb4d78bcf073375c8e96e2c35bc9317042 Antispam app refactor. For Django 1.7.7 upgrade. diff -r 0365fdbb4d78 -r 886234943aed antispam/__init__.py --- a/antispam/__init__.py Mon Apr 06 20:02:25 2015 -0500 +++ b/antispam/__init__.py Mon Apr 06 20:14:10 2015 -0500 @@ -1,12 +1,6 @@ -from django.contrib.auth import views as auth_views - -from antispam.decorators import log_auth_failures -import antispam.receivers +default_app_config = 'antispam.apps.AntiSpamConfig' SPAM_PHRASE_KEY = "antispam.spam_phrases" BUSTED_MESSAGE = ("Your post has tripped our spam filter. Your account has " "been suspended pending a review of your post. If this was a mistake " "then we apologize; your account will be restored shortly.") - -# Install rate limiting on auth login -auth_views.login = log_auth_failures('Login')(auth_views.login) diff -r 0365fdbb4d78 -r 886234943aed antispam/apps.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/antispam/apps.py Mon Apr 06 20:14:10 2015 -0500 @@ -0,0 +1,16 @@ +from django.apps import AppConfig +import django.contrib.auth.views + +from antispam.decorators import log_auth_failures + + +class AntiSpamConfig(AppConfig): + name = 'antispam' + verbose_name = 'Anti-Spam' + + def ready(self): + import antispam.receivers + + # Install rate limiting on auth login + django.contrib.auth.views.login = log_auth_failures('Login')( + django.contrib.auth.views.login)