✨ Modernize bit bit
- bumps - poetry - linting
This commit is contained in:
1 parent
3b9a43fc7a
commit
b12413ed67
31 files changed
+1409
-331
No files matched your search
+8
-9
@@ -12,21 +12,21 @@ class BaseModel(models.Model):
|
||||
class Alias(BaseModel):
|
||||
source = models.EmailField(max_length=254)
|
||||
destination = models.EmailField(max_length=254)
|
||||
domain = models.ForeignKey('dpdapi.Domain', models.CASCADE)
|
||||
domain = models.ForeignKey("dpdapi.Domain", models.CASCADE)
|
||||
active = models.BooleanField(default=True)
|
||||
|
||||
def __str__(self):
|
||||
return "{}={}".format(self.source, self.destination)
|
||||
return f"{self.source}={self.destination}"
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
self.source = self.source.lower()
|
||||
self.destination = self.destination.lower()
|
||||
|
||||
super(Alias, self).save(*args, **kwargs)
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
class Meta:
|
||||
verbose_name_plural = 'aliases'
|
||||
unique_together = ('source', 'destination', 'domain')
|
||||
verbose_name_plural = "aliases"
|
||||
unique_together = ("source", "destination", "domain")
|
||||
|
||||
|
||||
class Domain(BaseModel):
|
||||
@@ -38,13 +38,13 @@ class Domain(BaseModel):
|
||||
def save(self, *args, **kwargs):
|
||||
self.name = self.name.lower()
|
||||
|
||||
super(Domain, self).save(*args, **kwargs)
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
|
||||
class User(BaseModel):
|
||||
email = models.EmailField(max_length=254, unique=True)
|
||||
password = models.CharField(max_length=512)
|
||||
domain = models.ForeignKey('dpdapi.Domain', models.CASCADE)
|
||||
domain = models.ForeignKey("dpdapi.Domain", models.CASCADE)
|
||||
|
||||
def __str__(self):
|
||||
return self.email
|
||||
@@ -52,5 +52,4 @@ class User(BaseModel):
|
||||
def save(self, *args, **kwargs):
|
||||
self.email = self.email.lower()
|
||||
|
||||
super(User, self).save(*args, **kwargs)
|
||||
|
||||
super().save(*args, **kwargs)
|
||||
Reference in new issue
Block a user