See #872: added a new terms of service setting

This commit is contained in:
Eliot Berriot 2019-09-16 11:33:33 +02:00
parent 01d2206001
commit 5ca3055713
No known key found for this signature in database
GPG Key ID: DD6965E2476E5C27
4 changed files with 19 additions and 1 deletions

View File

@ -43,6 +43,20 @@ class InstanceLongDescription(types.StringPreference):
field_kwargs = {"required": False}
@global_preferences_registry.register
class InstanceTerms(types.StringPreference):
show_in_api = True
section = instance
name = "terms"
verbose_name = "Terms of service"
default = ""
help_text = (
"Terms of service and privacy policy for your instance (markdown allowed)."
)
widget = widgets.Textarea
field_kwargs = {"required": False}
@global_preferences_registry.register
class RavenDSN(types.StringPreference):
show_in_api = True

View File

@ -40,6 +40,7 @@ def get():
"private": all_preferences.get("instance__nodeinfo_private"),
"shortDescription": all_preferences.get("instance__short_description"),
"longDescription": all_preferences.get("instance__long_description"),
"terms": all_preferences.get("instance__terms"),
"nodeName": all_preferences.get("instance__name"),
"library": {
"federationEnabled": all_preferences.get("federation__enabled"),

View File

@ -38,6 +38,7 @@ def test_nodeinfo_dump(preferences, mocker):
"shortDescription": preferences["instance__short_description"],
"longDescription": preferences["instance__long_description"],
"nodeName": preferences["instance__name"],
"terms": preferences["instance__terms"],
"library": {
"federationEnabled": preferences["federation__enabled"],
"federationNeedsApproval": preferences[
@ -105,6 +106,7 @@ def test_nodeinfo_dump_stats_disabled(preferences, mocker):
"shortDescription": preferences["instance__short_description"],
"longDescription": preferences["instance__long_description"],
"nodeName": preferences["instance__name"],
"terms": preferences["instance__terms"],
"library": {
"federationEnabled": preferences["federation__enabled"],
"federationNeedsApproval": preferences[

View File

@ -94,7 +94,8 @@ export default {
settings: [
"instance__name",
"instance__short_description",
"instance__long_description"
"instance__long_description",
"instance__terms",
]
},
{