1843: fix bugs in model and schema introduced by #1604 r=mergify[bot] a=ghostwheel42

## What type of PR?

bug fix. linter complained about "== True" but with sqlalchemy this is correct

## What does this PR do?

### Related issue(s)
closes #1842

## Prerequistes
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [ ] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/guide.html#changelog) entry file.


Co-authored-by: Alexander Graf <ghostwheel42@users.noreply.github.com>
master
bors[bot] 3 years ago committed by GitHub
commit 20db642795
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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))
)

@ -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

Loading…
Cancel
Save