1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-01-16 02:46:44 +02:00

fix bugs in model and schema introduced by #1604

This commit is contained in:
Alexander Graf 2021-07-03 11:40:32 +02:00
parent 7481a6d272
commit 92896ae646
2 changed files with 5 additions and 5 deletions

View File

@ -628,10 +628,10 @@ class Alias(Base, Email):
sqlalchemy.and_(cls.domain_name == domain_name,
sqlalchemy.or_(
sqlalchemy.and_(
cls.wildcard is False,
cls.wildcard == False,
cls.localpart == localpart
), sqlalchemy.and_(
cls.wildcard is True,
cls.wildcard == True,
sqlalchemy.bindparam('l', localpart).like(cls.localpart)
)
)
@ -643,10 +643,10 @@ class Alias(Base, Email):
sqlalchemy.and_(cls.domain_name == domain_name,
sqlalchemy.or_(
sqlalchemy.and_(
cls.wildcard is False,
cls.wildcard == False,
sqlalchemy.func.lower(cls.localpart) == localpart_lower
), sqlalchemy.and_(
cls.wildcard is True,
cls.wildcard == True,
sqlalchemy.bindparam('l', localpart_lower).like(
sqlalchemy.func.lower(cls.localpart))
)

View File

@ -590,7 +590,7 @@ class DkimKeyField(fields.String):
value = value[:pos]
else:
footer = '-----END PRIVATE KEY-----'
except ValueError:
except ValueError as exc:
raise ValidationError(f'invalid dkim key {bad_key!r}') from exc
# remove whitespace from key data