See #872: added a new terms of service setting
This commit is contained in:
parent
01d2206001
commit
5ca3055713
|
@ -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",
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue