beware of upper and lower case in community url

This commit is contained in:
rimu 2024-01-29 09:16:43 +13:00
parent fec2d24e6d
commit a17e3273bf

View file

@ -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