mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
Clobber PeerTube communitites to restrict posting to mods irrespective of what JSON says
This commit is contained in:
parent
3219a55d98
commit
788cad653b
2 changed files with 4 additions and 0 deletions
|
@ -611,6 +611,9 @@ def refresh_community_profile_task(community_id):
|
|||
new_language = find_language_or_create(ap_language['identifier'], ap_language['name'])
|
||||
if new_language not in community.languages:
|
||||
community.languages.append(new_language)
|
||||
instance = Instance.query.get(community.instance_id)
|
||||
if instance and instance.software == 'peertube':
|
||||
community.restricted_to_mods = True
|
||||
db.session.commit()
|
||||
if community.icon_id and icon_changed:
|
||||
make_image_sizes(community.icon_id, 60, 250, 'communities')
|
||||
|
|
|
@ -94,6 +94,7 @@ def retrieve_peertube_mods_and_backfill(community_id: int, mods: list):
|
|||
else:
|
||||
new_membership = CommunityMember(community_id=community.id, user_id=user.id, is_moderator=True)
|
||||
db.session.add(new_membership)
|
||||
community.restricted_to_mods = True
|
||||
db.session.commit()
|
||||
|
||||
if community.ap_public_url:
|
||||
|
|
Loading…
Add table
Reference in a new issue