Browse Source

Resolve "Remove the unused `federation__music_needs_approval` settings"

merge-requests/981/merge
Ciarán Ainsworth 2 years ago
parent
commit
b422612edf
  1. 12
      api/funkwhale_api/federation/dynamic_preferences_registry.py
  2. 3
      api/funkwhale_api/instance/nodeinfo.py
  3. 6
      api/tests/instance/test_nodeinfo.py
  4. 1
      changes/changelog.d/959.enhancement
  5. 1
      demo/setup.sh
  6. 1
      front/src/views/admin/Settings.vue

12
api/funkwhale_api/federation/dynamic_preferences_registry.py

@ -53,15 +53,3 @@ class ActorFetchDelay(preferences.DefaultFromSettingMixin, types.IntPreference):
"request authentication."
)
field_kwargs = {"required": False}
@global_preferences_registry.register
class MusicNeedsApproval(preferences.DefaultFromSettingMixin, types.BooleanPreference):
section = federation
name = "music_needs_approval"
setting = "FEDERATION_MUSIC_NEEDS_APPROVAL"
verbose_name = "Federation music needs approval"
help_text = (
"When true, other federation actors will need your approval"
" before being able to browse your library."
)

3
api/funkwhale_api/instance/nodeinfo.py

@ -53,9 +53,6 @@ def get():
"defaultUploadQuota": all_preferences.get("users__upload_quota"),
"library": {
"federationEnabled": all_preferences.get("federation__enabled"),
"federationNeedsApproval": all_preferences.get(
"federation__music_needs_approval"
),
"anonymousCanListen": not all_preferences.get(
"common__api_authentication_required"
),

6
api/tests/instance/test_nodeinfo.py

@ -50,9 +50,6 @@ def test_nodeinfo_dump(preferences, mocker, avatar):
"banner": federation_utils.full_url(preferences["instance__banner"].url),
"library": {
"federationEnabled": preferences["federation__enabled"],
"federationNeedsApproval": preferences[
"federation__music_needs_approval"
],
"anonymousCanListen": not preferences[
"common__api_authentication_required"
],
@ -129,9 +126,6 @@ def test_nodeinfo_dump_stats_disabled(preferences, mocker):
"banner": None,
"library": {
"federationEnabled": preferences["federation__enabled"],
"federationNeedsApproval": preferences[
"federation__music_needs_approval"
],
"anonymousCanListen": not preferences[
"common__api_authentication_required"
],

1
changes/changelog.d/959.enhancement

@ -0,0 +1 @@
Removed unnecessary "Federation music needs approval" setting (#959)

1
demo/setup.sh

@ -54,7 +54,6 @@ from funkwhale_api.common import preferences
manager = preferences.global_preferences_registry.manager()
manager['common__api_authentication_required'] = False
manager['federation__music_needs_approval'] = False
manager['instance__name'] = "Login: demo / password: demo"
paths = [

1
front/src/views/admin/Settings.vue

@ -139,7 +139,6 @@ export default {
id: "federation",
settings: [
"federation__enabled",
"federation__music_needs_approval",
"federation__collection_page_size",
"federation__music_cache_duration",
"federation__actor_fetch_delay"

Loading…
Cancel
Save