from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.core.mail import EmailMultiAlternatives # noqa: F401
from functools import wraps
@@ -19,7 +19,7 @@ def do_monkey_patch():
# Remove this function from existence
global do_monkey_patch
do_monkey_patch = lambda: None
do_monkey_patch = lambda: None # noqa: E731
def patch_speaker_profile_form():
@@ -34,7 +34,7 @@ def patch_speaker_profile_form():
fields["accessibility"].widget = widgets.AceMarkdownEditor()
def patch_mail_to_send_bcc():
def patch_mail_to_send_bcc(): # noqa: C901
''' Patches django.core.mail's message classes to send a BCC e-mail to
the default BCC e-mail address. '''
@@ -80,7 +80,6 @@ def patch_mail_to_send_bcc():
return tuple(a[:pos] + (bcc,) + a[pos + 1:])
def patch_bcc_keyword(f, k):
''' Adds our BCC list to the BCC list in the keyword arguments, and
returns the new version of the keyword arguments.
@@ -139,13 +138,14 @@ def fix_sitetree_check_access_500s():
SiteTree.check_access = check_access
def never_cache_login_page():
from django.views.decorators.cache import never_cache
from account.views import LoginView
LoginView.get = never_cache(LoginView.get)
def patch_stripe_payment_form():
def patch_stripe_payment_form(): # noqa: C901
import inspect # Oh no.
from django.http.request import HttpRequest