Merge branch '872-additional-settings' into 'develop'
See #872: rules and contact email settings See merge request funkwhale/funkwhale!898
This commit is contained in:
commit
c2f0491c20
|
@ -59,6 +59,29 @@ class InstanceTerms(types.StringPreference):
|
||||||
field_kwargs = {"required": False}
|
field_kwargs = {"required": False}
|
||||||
|
|
||||||
|
|
||||||
|
@global_preferences_registry.register
|
||||||
|
class InstanceRules(types.StringPreference):
|
||||||
|
show_in_api = True
|
||||||
|
section = instance
|
||||||
|
name = "rules"
|
||||||
|
verbose_name = "Rules"
|
||||||
|
default = ""
|
||||||
|
help_text = "Rules/Code of Conduct (markdown allowed)."
|
||||||
|
widget = widgets.Textarea
|
||||||
|
field_kwargs = {"required": False}
|
||||||
|
|
||||||
|
|
||||||
|
@global_preferences_registry.register
|
||||||
|
class InstanceContactEmail(types.StringPreference):
|
||||||
|
show_in_api = True
|
||||||
|
section = instance
|
||||||
|
name = "contact_email"
|
||||||
|
verbose_name = "Contact email"
|
||||||
|
default = ""
|
||||||
|
help_text = "A contact email for visitors who need to contact an admin or moderator"
|
||||||
|
field_kwargs = {"required": False}
|
||||||
|
|
||||||
|
|
||||||
@global_preferences_registry.register
|
@global_preferences_registry.register
|
||||||
class RavenDSN(types.StringPreference):
|
class RavenDSN(types.StringPreference):
|
||||||
show_in_api = True
|
show_in_api = True
|
||||||
|
|
|
@ -42,6 +42,8 @@ def get():
|
||||||
"private": all_preferences.get("instance__nodeinfo_private"),
|
"private": all_preferences.get("instance__nodeinfo_private"),
|
||||||
"shortDescription": all_preferences.get("instance__short_description"),
|
"shortDescription": all_preferences.get("instance__short_description"),
|
||||||
"longDescription": all_preferences.get("instance__long_description"),
|
"longDescription": all_preferences.get("instance__long_description"),
|
||||||
|
"rules": all_preferences.get("instance__rules"),
|
||||||
|
"contactEmail": all_preferences.get("instance__contact_email"),
|
||||||
"terms": all_preferences.get("instance__terms"),
|
"terms": all_preferences.get("instance__terms"),
|
||||||
"nodeName": all_preferences.get("instance__name"),
|
"nodeName": all_preferences.get("instance__name"),
|
||||||
"banner": federation_utils.full_url(banner.url) if banner else None,
|
"banner": federation_utils.full_url(banner.url) if banner else None,
|
||||||
|
|
|
@ -40,6 +40,8 @@ def test_nodeinfo_dump(preferences, mocker, avatar):
|
||||||
"shortDescription": preferences["instance__short_description"],
|
"shortDescription": preferences["instance__short_description"],
|
||||||
"longDescription": preferences["instance__long_description"],
|
"longDescription": preferences["instance__long_description"],
|
||||||
"nodeName": preferences["instance__name"],
|
"nodeName": preferences["instance__name"],
|
||||||
|
"rules": preferences["instance__rules"],
|
||||||
|
"contactEmail": preferences["instance__contact_email"],
|
||||||
"terms": preferences["instance__terms"],
|
"terms": preferences["instance__terms"],
|
||||||
"banner": federation_utils.full_url(preferences["instance__banner"].url),
|
"banner": federation_utils.full_url(preferences["instance__banner"].url),
|
||||||
"library": {
|
"library": {
|
||||||
|
@ -109,6 +111,8 @@ def test_nodeinfo_dump_stats_disabled(preferences, mocker):
|
||||||
"shortDescription": preferences["instance__short_description"],
|
"shortDescription": preferences["instance__short_description"],
|
||||||
"longDescription": preferences["instance__long_description"],
|
"longDescription": preferences["instance__long_description"],
|
||||||
"nodeName": preferences["instance__name"],
|
"nodeName": preferences["instance__name"],
|
||||||
|
"rules": preferences["instance__rules"],
|
||||||
|
"contactEmail": preferences["instance__contact_email"],
|
||||||
"terms": preferences["instance__terms"],
|
"terms": preferences["instance__terms"],
|
||||||
"banner": None,
|
"banner": None,
|
||||||
"library": {
|
"library": {
|
||||||
|
|
|
@ -95,6 +95,8 @@ export default {
|
||||||
"instance__name",
|
"instance__name",
|
||||||
"instance__short_description",
|
"instance__short_description",
|
||||||
"instance__long_description",
|
"instance__long_description",
|
||||||
|
"instance__contact_email",
|
||||||
|
"instance__rules",
|
||||||
"instance__terms",
|
"instance__terms",
|
||||||
"instance__banner",
|
"instance__banner",
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue