Yet more stuff that was missed in the previous changes.
Signed-off-by: Stephen Finucane
---
patchwork/management/commands/parsearchive.py | 26 -
patchwork/management/commands/parsemail.py| 33 ++--
patchwork/settings/dev.py | 56 +++
patchwork/settings/production.example.py | 7 +---
4 files changed, 44 insertions(+), 78 deletions(-)
diff --git a/patchwork/management/commands/parsearchive.py
b/patchwork/management/commands/parsearchive.py
index f5ea4af4..16ca80f6 100644
--- a/patchwork/management/commands/parsearchive.py
+++ b/patchwork/management/commands/parsearchive.py
@@ -19,7 +19,6 @@
import logging
import mailbox
-from optparse import make_option
import os
import sys
@@ -35,23 +34,14 @@ logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'Parse an mbox archive file and store any patches/comments found.'
-if django.VERSION < (1, 8):
-args = ''
-option_list = BaseCommand.option_list + (
-make_option(
-'--list-id',
-help='mailing list ID. If not supplied, this will be '
-'extracted from the mail headers.'),
-)
-else:
-def add_arguments(self, parser):
-parser.add_argument(
-'infile',
-help='input mbox filename')
-parser.add_argument(
-'--list-id',
-help='mailing list ID. If not supplied, this will be '
-'extracted from the mail headers.')
+def add_arguments(self, parser):
+parser.add_argument(
+'infile',
+help='input mbox filename')
+parser.add_argument(
+'--list-id',
+help='mailing list ID. If not supplied, this will be '
+'extracted from the mail headers.')
def handle(self, *args, **options):
results = {
diff --git a/patchwork/management/commands/parsemail.py
b/patchwork/management/commands/parsemail.py
index 52ec8bc5..6d9825f7 100644
--- a/patchwork/management/commands/parsemail.py
+++ b/patchwork/management/commands/parsemail.py
@@ -19,10 +19,8 @@
import email
import logging
-from optparse import make_option
import sys
-import django
from django.core.management import base
from django.utils import six
@@ -34,26 +32,17 @@ logger = logging.getLogger(__name__)
class Command(base.BaseCommand):
help = 'Parse an mbox file and store any patch/comment found.'
-if django.VERSION < (1, 8):
-args = ''
-option_list = base.BaseCommand.option_list + (
-make_option(
-'--list-id',
-help='mailing list ID. If not supplied, this will be '
-'extracted from the mail headers.'),
-)
-else:
-def add_arguments(self, parser):
-parser.add_argument(
-'infile',
-nargs='?',
-type=str,
-default=None,
-help='input mbox file (a filename or stdin)')
-parser.add_argument(
-'--list-id',
-help='mailing list ID. If not supplied, this will be '
-'extracted from the mail headers.')
+def add_arguments(self, parser):
+parser.add_argument(
+'infile',
+nargs='?',
+type=str,
+default=None,
+help='input mbox file (a filename or stdin)')
+parser.add_argument(
+'--list-id',
+help='mailing list ID. If not supplied, this will be '
+'extracted from the mail headers.')
def handle(self, *args, **options):
infile = args[0] if args else options['infile']
diff --git a/patchwork/settings/dev.py b/patchwork/settings/dev.py
index 26d3e830..1f686f42 100644
--- a/patchwork/settings/dev.py
+++ b/patchwork/settings/dev.py
@@ -25,11 +25,6 @@ SECRET_KEY =
'00' # noqa
DEBUG = True
-if django.VERSION < (1, 8):
-# In Django 1.8+, this is only necessary if the value differs from
-# the value for 'DEBUG'
-TEMPLATE_DEBUG = True
-
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
@@ -38,19 +33,15 @@ DATABASES = {
'USER': os.getenv('PW_TEST_DB_USER', 'patchwork'),
'PASSWORD': os.getenv('PW_TEST_DB_PASS', 'password'),
'NAME': os.getenv('PW_TEST_DB_NAME', 'patchwork'),
+'TEST': {
+'CHARSET': 'utf8',
+},
},
}
if os.getenv('PW_TEST_DB_TYPE', None) == 'postgres':
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
-if django.VERSION >= (1, 7):
-DATABASES['default']['TEST'] = {
-'CHARSET': 'utf8',
-}
-else:
-DATABASES['default']['TEST_CHARSET'] = 'utf8'
-
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
#
@@ -68,27 +59,26 @@ PASSWORD_HASHERS =