Verified Commit 5ca30557 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

See #872: added a new terms of service setting

parent 01d22060
......@@ -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
......
......@@ -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"),
......
......@@ -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[
......
......@@ -94,7 +94,8 @@ export default {
settings: [
"instance__name",
"instance__short_description",
"instance__long_description"
"instance__long_description",
"instance__terms",
]
},
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment