test new design 07.1

This commit is contained in:
TronoSfera 2026-04-07 18:21:36 +03:00
parent c48f39b5d8
commit 4fc65bf9a7
2 changed files with 4 additions and 4 deletions

View file

@ -100,7 +100,7 @@ def _enrich_landing_featured_staff(rows: list[dict[str, Any]], db: Session) -> l
bool(row.get("enabled")) bool(row.get("enabled"))
and user is not None and user is not None
and bool(user.is_active) and bool(user.is_active)
and str(getattr(user, "role", "") or "").upper() in ("ADMIN", "LAWYER") and str(getattr(user, "role", "") or "").upper() in ("ADMIN", "LAWYER", "CURATOR")
) )
result.append({**row, "visible_on_landing": visible}) result.append({**row, "visible_on_landing": visible})
return result return result

View file

@ -48,7 +48,7 @@ def list_featured_staff(
.filter( .filter(
LandingFeaturedStaff.enabled.is_(True), LandingFeaturedStaff.enabled.is_(True),
AdminUser.is_active.is_(True), AdminUser.is_active.is_(True),
AdminUser.role.in_(("ADMIN", "LAWYER")), AdminUser.role.in_(("ADMIN", "LAWYER", "CURATOR")),
) )
.order_by( .order_by(
LandingFeaturedStaff.pinned.desc(), LandingFeaturedStaff.pinned.desc(),
@ -62,7 +62,7 @@ def list_featured_staff(
result = [] result = []
for slot, user in rows: for slot, user in rows:
role_code = str(user.role or "").upper() role_code = str(user.role or "").upper()
role_label = "Администратор" if role_code == "ADMIN" else "Юрист" role_label = "Администратор" if role_code == "ADMIN" else "Куратор" if role_code == "CURATOR" else "Юрист"
primary_topic_code = str(user.primary_topic_code or "").strip() or None primary_topic_code = str(user.primary_topic_code or "").strip() or None
raw_avatar_url = str(user.avatar_url or "").strip() raw_avatar_url = str(user.avatar_url or "").strip()
avatar_url = raw_avatar_url avatar_url = raw_avatar_url
@ -104,7 +104,7 @@ def get_featured_staff_avatar(
LandingFeaturedStaff.enabled.is_(True), LandingFeaturedStaff.enabled.is_(True),
AdminUser.id == user_uuid, AdminUser.id == user_uuid,
AdminUser.is_active.is_(True), AdminUser.is_active.is_(True),
AdminUser.role.in_(("ADMIN", "LAWYER")), AdminUser.role.in_(("ADMIN", "LAWYER", "CURATOR")),
AdminUser.avatar_url.is_not(None), AdminUser.avatar_url.is_not(None),
and_(AdminUser.avatar_url != ""), and_(AdminUser.avatar_url != ""),
) )