Update routes.py
This commit is contained in:
parent
cbf6a0498b
commit
c8e0501d3c
49
routes.py
49
routes.py
@ -4063,7 +4063,11 @@ def register_routes(app, ctx):
|
|||||||
settings_row = db.execute(
|
settings_row = db.execute(
|
||||||
"""
|
"""
|
||||||
SELECT
|
SELECT
|
||||||
name_color
|
name_color,
|
||||||
|
profile_background_color,
|
||||||
|
profile_banner_color,
|
||||||
|
profile_visibility,
|
||||||
|
last_active_visibility
|
||||||
FROM user_settings
|
FROM user_settings
|
||||||
WHERE user_id = ?
|
WHERE user_id = ?
|
||||||
""",
|
""",
|
||||||
@ -4170,7 +4174,16 @@ def register_routes(app, ctx):
|
|||||||
).fetchone()
|
).fetchone()
|
||||||
|
|
||||||
settings_row = db.execute(
|
settings_row = db.execute(
|
||||||
"SELECT name_color FROM user_settings WHERE user_id = ?",
|
"""
|
||||||
|
SELECT
|
||||||
|
name_color,
|
||||||
|
profile_background_color,
|
||||||
|
profile_banner_color,
|
||||||
|
profile_visibility,
|
||||||
|
last_active_visibility
|
||||||
|
FROM user_settings
|
||||||
|
WHERE user_id = ?
|
||||||
|
""",
|
||||||
(user["id"],),
|
(user["id"],),
|
||||||
).fetchone()
|
).fetchone()
|
||||||
|
|
||||||
@ -4218,7 +4231,16 @@ def register_routes(app, ctx):
|
|||||||
).fetchone()
|
).fetchone()
|
||||||
|
|
||||||
settings_row = db.execute(
|
settings_row = db.execute(
|
||||||
"SELECT name_color FROM user_settings WHERE user_id = ?",
|
"""
|
||||||
|
SELECT
|
||||||
|
name_color,
|
||||||
|
profile_background_color,
|
||||||
|
profile_banner_color,
|
||||||
|
profile_visibility,
|
||||||
|
last_active_visibility
|
||||||
|
FROM user_settings
|
||||||
|
WHERE user_id = ?
|
||||||
|
""",
|
||||||
(user_row["id"],),
|
(user_row["id"],),
|
||||||
).fetchone()
|
).fetchone()
|
||||||
|
|
||||||
@ -4238,6 +4260,10 @@ def register_routes(app, ctx):
|
|||||||
name_color,
|
name_color,
|
||||||
custom_css,
|
custom_css,
|
||||||
theme_mode,
|
theme_mode,
|
||||||
|
profile_background_color,
|
||||||
|
profile_banner_color,
|
||||||
|
profile_visibility,
|
||||||
|
last_active_visibility,
|
||||||
updated_at
|
updated_at
|
||||||
FROM user_settings
|
FROM user_settings
|
||||||
WHERE user_id = ?
|
WHERE user_id = ?
|
||||||
@ -4245,6 +4271,7 @@ def register_routes(app, ctx):
|
|||||||
(user["id"],),
|
(user["id"],),
|
||||||
).fetchone()
|
).fetchone()
|
||||||
|
|
||||||
|
|
||||||
return jsonify(
|
return jsonify(
|
||||||
{
|
{
|
||||||
"settings": {
|
"settings": {
|
||||||
@ -4252,6 +4279,10 @@ def register_routes(app, ctx):
|
|||||||
"name_color": row["name_color"],
|
"name_color": row["name_color"],
|
||||||
"custom_css": row["custom_css"],
|
"custom_css": row["custom_css"],
|
||||||
"theme_mode": row["theme_mode"],
|
"theme_mode": row["theme_mode"],
|
||||||
|
"profile_background_color": row["profile_background_color"],
|
||||||
|
"profile_banner_color": row["profile_banner_color"],
|
||||||
|
"profile_visibility": row["profile_visibility"],
|
||||||
|
"last_active_visibility": row["last_active_visibility"],
|
||||||
"updated_at": row["updated_at"],
|
"updated_at": row["updated_at"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4297,6 +4328,10 @@ def register_routes(app, ctx):
|
|||||||
name_color = ?,
|
name_color = ?,
|
||||||
custom_css = ?,
|
custom_css = ?,
|
||||||
theme_mode = ?,
|
theme_mode = ?,
|
||||||
|
profile_background_color = ?,
|
||||||
|
profile_banner_color = ?,
|
||||||
|
profile_visibility = ?,
|
||||||
|
last_active_visibility = ?,
|
||||||
updated_at = ?
|
updated_at = ?
|
||||||
WHERE user_id = ?
|
WHERE user_id = ?
|
||||||
""",
|
""",
|
||||||
@ -4305,6 +4340,10 @@ def register_routes(app, ctx):
|
|||||||
normalized_hex_color(name_color) if name_color else None,
|
normalized_hex_color(name_color) if name_color else None,
|
||||||
custom_css,
|
custom_css,
|
||||||
theme_mode,
|
theme_mode,
|
||||||
|
data.get("profile_background_color"),
|
||||||
|
data.get("profile_banner_color"),
|
||||||
|
str(data.get("profile_visibility", "public")).strip().lower(),
|
||||||
|
str(data.get("last_active_visibility", "mutuals")).strip().lower(),
|
||||||
now_iso(),
|
now_iso(),
|
||||||
user["id"],
|
user["id"],
|
||||||
),
|
),
|
||||||
@ -4318,6 +4357,10 @@ def register_routes(app, ctx):
|
|||||||
name_color,
|
name_color,
|
||||||
custom_css,
|
custom_css,
|
||||||
theme_mode,
|
theme_mode,
|
||||||
|
profile_background_color,
|
||||||
|
profile_banner_color,
|
||||||
|
profile_visibility,
|
||||||
|
last_active_visibility,
|
||||||
updated_at
|
updated_at
|
||||||
FROM user_settings
|
FROM user_settings
|
||||||
WHERE user_id = ?
|
WHERE user_id = ?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user