Avoid error caused by fstab.sh admin with a http:// URL

This commit is contained in:
freamon 2024-12-01 02:31:37 +00:00
parent 64c40b11db
commit dfce93202e

View file

@ -283,8 +283,10 @@ def register(app):
instance_data = response.json()
admin_profile_ids = []
for admin in instance_data['admins']:
admin_profile_ids.append(admin['person']['actor_id'].lower())
user = find_actor_or_create(admin['person']['actor_id'])
profile_id = admin['person']['actor_id']
if profile_id.startswith('https://'):
admin_profile_ids.append(profile_id.lower())
user = find_actor_or_create(profile_id)
if user and not instance.user_is_admin(user.id):
new_instance_role = InstanceRole(instance_id=instance.id, user_id=user.id,
role='admin')