diff options
Diffstat (limited to 'patchwork/models.py')
-rw-r--r-- | patchwork/models.py | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/patchwork/models.py b/patchwork/models.py index e295e17..769f602 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -15,7 +15,6 @@ from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.db import models from django.urls import reverse -from django.utils.encoding import python_2_unicode_compatible from django.utils.functional import cached_property from patchwork.fields import HashField @@ -32,7 +31,6 @@ def validate_regex_compiles(regex_string): raise ValidationError('Invalid regular expression entered!') -@python_2_unicode_compatible class Person(models.Model): # properties @@ -55,7 +53,6 @@ class Person(models.Model): verbose_name_plural = 'People' -@python_2_unicode_compatible class Project(models.Model): # properties @@ -113,7 +110,6 @@ class Project(models.Model): ordering = ['linkname'] -@python_2_unicode_compatible class DelegationRule(models.Model): project = models.ForeignKey(Project, on_delete=models.CASCADE) user = models.ForeignKey( @@ -136,7 +132,6 @@ class DelegationRule(models.Model): unique_together = (('path', 'project')) -@python_2_unicode_compatible class UserProfile(models.Model): user = models.OneToOneField(User, unique=True, related_name='profile', on_delete=models.CASCADE) @@ -214,7 +209,6 @@ def _user_saved_callback(sender, created, instance, **kwargs): models.signals.post_save.connect(_user_saved_callback, sender=User) -@python_2_unicode_compatible class State(models.Model): # Both of these fields should be unique name = models.CharField(max_length=100, unique=True) @@ -229,7 +223,6 @@ class State(models.Model): ordering = ['ordering'] -@python_2_unicode_compatible class Tag(models.Model): name = models.CharField(max_length=20) pattern = models.CharField( @@ -346,10 +339,9 @@ class EmailMixin(models.Model): # Modifying a submission via admin interface changes '\n' newlines in # message content to '\r\n'. We need to fix them to avoid problems, # especially as git complains about malformed patches when PW runs - # on PY2 if self.content: + # on PY2 TODO: is this still needed on PY3? self.content = self.content.replace('\r\n', '\n') - super(EmailMixin, self).save(*args, **kwargs) class Meta: @@ -366,7 +358,6 @@ class FilenameMixin(object): return fname -@python_2_unicode_compatible class Submission(FilenameMixin, EmailMixin, models.Model): # parent @@ -419,7 +410,6 @@ class CoverLetter(Submission): 'msgid': self.url_msgid}) -@python_2_unicode_compatible class Patch(Submission): # patch metadata @@ -670,7 +660,6 @@ class Comment(EmailMixin, models.Model): ] -@python_2_unicode_compatible class Series(FilenameMixin, models.Model): """A collection of patches.""" @@ -785,7 +774,6 @@ class Series(FilenameMixin, models.Model): verbose_name_plural = 'Series' -@python_2_unicode_compatible class SeriesReference(models.Model): """A reference found in a series. @@ -871,7 +859,6 @@ class BundlePatch(models.Model): ordering = ['order'] -@python_2_unicode_compatible class PatchRelation(models.Model): def __str__(self): @@ -884,7 +871,6 @@ class PatchRelation(models.Model): return name -@python_2_unicode_compatible class Check(models.Model): """Check for a patch. @@ -1076,7 +1062,6 @@ class EmailConfirmation(models.Model): super(EmailConfirmation, self).save() -@python_2_unicode_compatible class EmailOptout(models.Model): email = models.CharField(max_length=200, primary_key=True) |