mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-03 21:59:16 +02:00
See #872: rules and contact email settings
This commit is contained in:
parent
853cd833b5
commit
dce7a74f7e
4 changed files with 31 additions and 0 deletions
|
@ -59,6 +59,29 @@ class InstanceTerms(types.StringPreference):
|
|||
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
|
||||
class RavenDSN(types.StringPreference):
|
||||
show_in_api = True
|
||||
|
|
|
@ -42,6 +42,8 @@ def get():
|
|||
"private": all_preferences.get("instance__nodeinfo_private"),
|
||||
"shortDescription": all_preferences.get("instance__short_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"),
|
||||
"nodeName": all_preferences.get("instance__name"),
|
||||
"banner": federation_utils.full_url(banner.url) if banner else None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue