From a17e3273bfaa6b2eb0eb54852425b14bf77894c1 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Mon, 29 Jan 2024 09:16:43 +1300 Subject: [PATCH] beware of upper and lower case in community url --- app/community/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/community/util.py b/app/community/util.py index 17f107a6..c0eadd5c 100644 --- a/app/community/util.py +++ b/app/community/util.py @@ -117,7 +117,7 @@ def retrieve_mods_and_backfill(community_id: int): def community_url_exists(url) -> bool: - community = Community.query.filter_by(ap_profile_id=url).first() + community = Community.query.filter(Community.ap_profile_id.ilike(url)).first() return community is not None @@ -126,7 +126,7 @@ def actor_to_community(actor) -> Community: if '@' in actor: community = Community.query.filter_by(banned=False, ap_id=actor).first() else: - community = Community.query.filter_by(name=actor, banned=False, ap_id=None).first() + community = Community.query.filter(Community.name.ilike(actor)).filter_by(banned=False, ap_id=None).first() return community