From 4ae5b3645998d03f39325acaa2db775b73e51e6b Mon Sep 17 00:00:00 2001 From: freamon Date: Sun, 24 Mar 2024 01:53:18 +0000 Subject: [PATCH] Lowercase the ap_profile_id of New Local Users and New Local Communties (to match behaviour for remote users and communities) --- app/admin/routes.py | 2 +- app/community/routes.py | 2 +- app/utils.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/admin/routes.py b/app/admin/routes.py index 2ecc2c54..beba0184 100644 --- a/app/admin/routes.py +++ b/app/admin/routes.py @@ -627,7 +627,7 @@ def admin_users_add(): private_key, public_key = RsaKeys.generate_keypair() user.private_key = private_key user.public_key = public_key - user.ap_profile_id = f"https://{current_app.config['SERVER_NAME']}/u/{user.user_name}" + user.ap_profile_id = f"https://{current_app.config['SERVER_NAME']}/u/{user.user_name}".lower() user.ap_public_url = f"https://{current_app.config['SERVER_NAME']}/u/{user.user_name}" user.ap_inbox_url = f"https://{current_app.config['SERVER_NAME']}/u/{user.user_name}/inbox" user.roles.append(Role.query.get(form.role.data)) diff --git a/app/community/routes.py b/app/community/routes.py index d6af868b..0e92c61a 100644 --- a/app/community/routes.py +++ b/app/community/routes.py @@ -49,7 +49,7 @@ def add_local(): rules=form.rules.data, nsfw=form.nsfw.data, private_key=private_key, public_key=public_key, description_html=markdown_to_html(form.description.data), rules_html=markdown_to_html(form.rules.data), local_only=form.local_only.data, - ap_profile_id='https://' + current_app.config['SERVER_NAME'] + '/c/' + form.url.data, + ap_profile_id='https://' + current_app.config['SERVER_NAME'] + '/c/' + form.url.data.lower(), ap_followers_url='https://' + current_app.config['SERVER_NAME'] + '/c/' + form.url.data + '/followers', ap_domain=current_app.config['SERVER_NAME'], subscriptions_count=1, instance_id=1, low_quality='memes' in form.url.data) diff --git a/app/utils.py b/app/utils.py index 5c6d2fcd..fa556b6a 100644 --- a/app/utils.py +++ b/app/utils.py @@ -670,7 +670,7 @@ def finalize_user_setup(user, application_required=False): private_key, public_key = RsaKeys.generate_keypair() user.private_key = private_key user.public_key = public_key - user.ap_profile_id = f"https://{current_app.config['SERVER_NAME']}/u/{user.user_name}" + user.ap_profile_id = f"https://{current_app.config['SERVER_NAME']}/u/{user.user_name}".lower() user.ap_public_url = f"https://{current_app.config['SERVER_NAME']}/u/{user.user_name}" user.ap_inbox_url = f"https://{current_app.config['SERVER_NAME']}/u/{user.user_name}/inbox" db.session.commit()