See #872: added a new terms of service setting

environments/review-front-872-onphyn/deployments/2632
Eliot Berriot 2019-09-16 11:33:33 +02:00
rodzic 01d2206001
commit 5ca3055713
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: DD6965E2476E5C27
4 zmienionych plików z 19 dodań i 1 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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"),

Wyświetl plik

@ -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[

Wyświetl plik

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