X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=apps%2Fpatchwork%2Fmodels.py;h=162fa21d68f2a6dcf4dc2bc054dc5ae429d46aa7;hb=ae419adbd60ba0343baacb9de46ef27ac99bcbf7;hp=1da1d998bece9d0b2d5046ca0a74666cbaf16318;hpb=94ae2713d4aca80b7dc1168a60f98bbe38d86e12;p=patchwork diff --git a/apps/patchwork/models.py b/apps/patchwork/models.py index 1da1d99..162fa21 100644 --- a/apps/patchwork/models.py +++ b/apps/patchwork/models.py @@ -23,7 +23,6 @@ from django.core.urlresolvers import reverse from django.contrib.sites.models import Site from django.conf import settings from patchwork.parser import hash_patch -import django.oldforms as oldforms import re import datetime, time @@ -179,7 +178,7 @@ class PatchMbox(MIMENonMultipart): class Patch(models.Model): project = models.ForeignKey(Project) - msgid = models.CharField(max_length=255, unique = True) + msgid = models.CharField(max_length=255) name = models.CharField(max_length=255) date = models.DateTimeField(default=datetime.datetime.now) submitter = models.ForeignKey(Person) @@ -266,10 +265,11 @@ class Patch(models.Model): class Meta: verbose_name_plural = 'Patches' ordering = ['date'] + unique_together = [('msgid', 'project')] class Comment(models.Model): patch = models.ForeignKey(Patch) - msgid = models.CharField(max_length=255, unique = True) + msgid = models.CharField(max_length=255) submitter = models.ForeignKey(Person) date = models.DateTimeField(default = datetime.datetime.now) headers = models.TextField(blank = True) @@ -283,6 +283,7 @@ class Comment(models.Model): class Meta: ordering = ['date'] + unique_together = [('msgid', 'patch')] class Bundle(models.Model): owner = models.ForeignKey(User) @@ -324,7 +325,7 @@ class UserPersonConfirmation(models.Model): return person = None try: - person = Person.objects.get(email = self.email) + person = Person.objects.get(email__iexact = self.email) except Exception: pass if not person: