Improve forms for user creation an deletion

This commit is contained in:
Pierre Jaury
2016-03-22 19:47:15 +01:00
parent 8d6a4cb654
commit 398e7c1183
9 changed files with 92 additions and 21 deletions

View File

@@ -39,6 +39,13 @@ class Domain(Base):
max_users = db.Column(db.Integer, nullable=True)
max_aliases = db.Column(db.Integer, nullable=True)
def has_address(self, localpart):
for address in self.users + self.aliases:
if address.localpart == localpart:
return True
else:
return False
def __str__(self):
return self.name