fix: is null sql statement (#4690)
* fix is null sql statement * use == since linter complains about is_ * [autofix.ci] apply automated fixes * ignore error --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
faee93e562
commit
50aa61826c
1 changed files with 2 additions and 1 deletions
|
|
@ -152,7 +152,8 @@ class DatabaseService(Service):
|
||||||
settings_service = get_settings_service()
|
settings_service = get_settings_service()
|
||||||
if settings_service.auth_settings.AUTO_LOGIN:
|
if settings_service.auth_settings.AUTO_LOGIN:
|
||||||
async with self.with_async_session() as session:
|
async with self.with_async_session() as session:
|
||||||
stmt = select(models.Flow).where(models.Flow.user_id is None)
|
# `== None` translates to SQL `is NULL`
|
||||||
|
stmt = select(models.Flow).where(models.Flow.user_id == None) # noqa: E711
|
||||||
flows = (await session.exec(stmt)).all()
|
flows = (await session.exec(stmt)).all()
|
||||||
if flows:
|
if flows:
|
||||||
logger.debug("Migrating flows to default superuser")
|
logger.debug("Migrating flows to default superuser")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue