CI: Make mypy happy
cleanmedia:133: error: Value of type "tuple[Any, ...] | None" is not indexable [index] So we do sanity check that row is not None now before doing something with row[0].
This commit is contained in:
parent
7d6dc981e3
commit
9eea97f1e1
@ -130,7 +130,7 @@ class MediaRepository:
|
|||||||
with self.conn.cursor() as cur:
|
with self.conn.cursor() as cur:
|
||||||
cur.execute("SELECT COUNT(media_id) from mediaapi_thumbnail WHERE media_id NOT IN (SELECT media_id FROM mediaapi_media_repository);")
|
cur.execute("SELECT COUNT(media_id) from mediaapi_thumbnail WHERE media_id NOT IN (SELECT media_id FROM mediaapi_media_repository);")
|
||||||
row = cur.fetchone()
|
row = cur.fetchone()
|
||||||
if row[0]:
|
if row is not None and row[0]:
|
||||||
logging.error("You have {} thumbnails in your db that do not refer to media. This needs fixing (we don't do that)!".format(row[0]))
|
logging.error("You have {} thumbnails in your db that do not refer to media. This needs fixing (we don't do that)!".format(row[0]))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user