mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-23 06:35:23 +01:00
fix flake8 E711 (comparison-to-none)
This commit is contained in:
parent
eba7319808
commit
86e8a3a315
9 changed files with 10 additions and 10 deletions
|
@ -358,7 +358,7 @@ async def get_payments(
|
||||||
args: List[Any] = []
|
args: List[Any] = []
|
||||||
clause: List[str] = []
|
clause: List[str] = []
|
||||||
|
|
||||||
if since != None:
|
if since is not None:
|
||||||
if db.type == POSTGRES:
|
if db.type == POSTGRES:
|
||||||
clause.append("time > to_timestamp(?)")
|
clause.append("time > to_timestamp(?)")
|
||||||
elif db.type == COCKROACH:
|
elif db.type == COCKROACH:
|
||||||
|
|
|
@ -37,7 +37,7 @@ async def run_migration(db: Connection, migrations_module: Any, current_version:
|
||||||
print(f"running migration {db_name}.{version}")
|
print(f"running migration {db_name}.{version}")
|
||||||
await migrate(db)
|
await migrate(db)
|
||||||
|
|
||||||
if db.schema == None:
|
if db.schema is None:
|
||||||
await update_migration_version(db, db_name, version)
|
await update_migration_version(db, db_name, version)
|
||||||
else:
|
else:
|
||||||
async with core_db.connect() as conn:
|
async with core_db.connect() as conn:
|
||||||
|
|
|
@ -120,7 +120,7 @@ async def extensions_install(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
await update_installed_extension_state(
|
await update_installed_extension_state(
|
||||||
ext_id=ext_id, active=activate != None
|
ext_id=ext_id, active=activate is not None
|
||||||
)
|
)
|
||||||
|
|
||||||
all_extensions = list(map(lambda e: e.code, get_valid_extensions()))
|
all_extensions = list(map(lambda e: e.code, get_valid_extensions()))
|
||||||
|
|
|
@ -31,7 +31,7 @@ def si_formatter(value):
|
||||||
the value cannot be classified.
|
the value cannot be classified.
|
||||||
"""
|
"""
|
||||||
classifier = si_classifier(value)
|
classifier = si_classifier(value)
|
||||||
if classifier == None:
|
if classifier is None:
|
||||||
# Don't know how to classify this value
|
# Don't know how to classify this value
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ def si_format(value, precision=4, long_form=False, separator=""):
|
||||||
"""
|
"""
|
||||||
scaled, short_suffix, long_suffix = si_formatter(value)
|
scaled, short_suffix, long_suffix = si_formatter(value)
|
||||||
|
|
||||||
if scaled == None:
|
if scaled is None:
|
||||||
# Don't know how to format this value
|
# Don't know how to format this value
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ async def get_jukebox_by_user(user: str) -> Optional[Jukebox]:
|
||||||
async def get_jukeboxs(user: str) -> List[Jukebox]:
|
async def get_jukeboxs(user: str) -> List[Jukebox]:
|
||||||
rows = await db.fetchall('SELECT * FROM jukebox.jukebox WHERE "user" = ?', (user,))
|
rows = await db.fetchall('SELECT * FROM jukebox.jukebox WHERE "user" = ?', (user,))
|
||||||
for row in rows:
|
for row in rows:
|
||||||
if row.sp_playlists == None:
|
if row.sp_playlists is None:
|
||||||
await delete_jukebox(row.id)
|
await delete_jukebox(row.id)
|
||||||
rows = await db.fetchall('SELECT * FROM jukebox.jukebox WHERE "user" = ?', (user,))
|
rows = await db.fetchall('SELECT * FROM jukebox.jukebox WHERE "user" = ?', (user,))
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ async def api_link_create_or_update(
|
||||||
detail="Min is greater than max.", status_code=HTTPStatus.BAD_REQUEST
|
detail="Min is greater than max.", status_code=HTTPStatus.BAD_REQUEST
|
||||||
)
|
)
|
||||||
|
|
||||||
if data.currency == None and (
|
if data.currency is None and (
|
||||||
round(data.min) != data.min or round(data.max) != data.max or data.min < 1
|
round(data.min) != data.min or round(data.max) != data.max or data.min < 1
|
||||||
):
|
):
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
|
|
@ -78,7 +78,7 @@ async def api_add_or_update_item(
|
||||||
)
|
)
|
||||||
if data.unit != "sat":
|
if data.unit != "sat":
|
||||||
data.price = data.price * 100
|
data.price = data.price * 100
|
||||||
if item_id == None:
|
if item_id is None:
|
||||||
|
|
||||||
await add_item(
|
await add_item(
|
||||||
shop.id,
|
shop.id,
|
||||||
|
|
|
@ -12,7 +12,7 @@ def isValidDomain(str):
|
||||||
|
|
||||||
# If the string is empty
|
# If the string is empty
|
||||||
# return false
|
# return false
|
||||||
if str == None:
|
if str is None:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Return if the string
|
# Return if the string
|
||||||
|
|
|
@ -41,7 +41,7 @@ class PaymentStatus(NamedTuple):
|
||||||
return "settled"
|
return "settled"
|
||||||
elif self.paid is False:
|
elif self.paid is False:
|
||||||
return "failed"
|
return "failed"
|
||||||
elif self.paid == None:
|
elif self.paid is None:
|
||||||
return "still pending"
|
return "still pending"
|
||||||
else:
|
else:
|
||||||
return "unknown (should never happen)"
|
return "unknown (should never happen)"
|
||||||
|
|
Loading…
Add table
Reference in a new issue