summaryrefslogtreecommitdiffstats
path: root/apps/patchwork/bin
diff options
context:
space:
mode:
authorDirk Wallenstein <halsmit@t-online.de>2012-04-29 03:11:48 +0000
committerJeremy Kerr <jk@ozlabs.org>2012-04-30 14:22:21 +0800
commit55ef92901f11ce5497eb55df3064a5a74821a1e7 (patch)
tree5e71b419f53c6cdd4c5717559ab2dd47d8045d4e /apps/patchwork/bin
parentb76f7dd32ef83d55ace2f38ed84f5fc76e65e18e (diff)
downloadpatchwork-55ef92901f11ce5497eb55df3064a5a74821a1e7.tar.bz2
patchwork-55ef92901f11ce5497eb55df3064a5a74821a1e7.tar.xz
Use an explicit initial default patch state
This will make editing states through the admin UI less error-prone, and will facilitate parsing patches when relying on a default state, as well as testing. Use the explicit default state when parsing mails. Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps/patchwork/bin')
-rwxr-xr-xapps/patchwork/bin/parsemail.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/patchwork/bin/parsemail.py b/apps/patchwork/bin/parsemail.py
index 52c85fe..b6eb97a 100755
--- a/apps/patchwork/bin/parsemail.py
+++ b/apps/patchwork/bin/parsemail.py
@@ -34,10 +34,10 @@ except ImportError:
from email.Utils import parsedate_tz, mktime_tz
from patchwork.parser import parse_patch
-from patchwork.models import Patch, Project, Person, Comment, State
+from patchwork.models import Patch, Project, Person, Comment, State, \
+ get_default_initial_patch_state
from django.contrib.auth.models import User
-default_patch_state = 'New'
list_id_headers = ['List-ID', 'X-Mailing-List', 'X-list']
whitespace_re = re.compile('\s+')
@@ -349,7 +349,7 @@ def get_state(state_name):
return State.objects.get(name__iexact=state_name)
except State.DoesNotExist:
pass
- return State.objects.get(name=default_patch_state)
+ return get_default_initial_patch_state()
def get_delegate(delegate_email):
""" Return the delegate with the given email or None """