Tried to fix a broke filter.
Build LinkLog Development Image / development-image (push) Successful in 10s
Build LinkLog Development Image / development-image (push) Successful in 10s
This commit is contained in:
@@ -227,32 +227,9 @@ def list_public_users():
|
||||
return [row['username'] for row in rows]
|
||||
|
||||
|
||||
def list_tags(user_id: str | None = None):
|
||||
def list_tags():
|
||||
with get_connection() as conn:
|
||||
if user_id:
|
||||
rows = conn.execute(
|
||||
'''
|
||||
SELECT tags.name
|
||||
FROM tags
|
||||
LEFT JOIN users ON users.id = tags.created_by
|
||||
WHERE tags.created_by IS NULL
|
||||
OR tags.created_by = ?
|
||||
OR users.is_admin = 1
|
||||
ORDER BY tags.name
|
||||
''',
|
||||
(user_id,),
|
||||
).fetchall()
|
||||
else:
|
||||
rows = conn.execute(
|
||||
'''
|
||||
SELECT tags.name
|
||||
FROM tags
|
||||
LEFT JOIN users ON users.id = tags.created_by
|
||||
WHERE tags.created_by IS NULL
|
||||
OR users.is_admin = 1
|
||||
ORDER BY tags.name
|
||||
''',
|
||||
).fetchall()
|
||||
rows = conn.execute('SELECT name FROM tags ORDER BY name').fetchall()
|
||||
tags = []
|
||||
seen = set()
|
||||
for row in rows:
|
||||
|
||||
Reference in New Issue
Block a user