Make max_media_attachments configurable by admin (#669)

pull/675/head
Rob 2023-11-29 01:52:04 +09:00 zatwierdzone przez GitHub
rodzic ac7fef4b28
commit 5f28d702f8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -41,7 +41,7 @@ def instance_info_v1(request):
"accounts": {},
"statuses": {
"max_characters": Config.system.post_length,
"max_media_attachments": 4,
"max_media_attachments": Config.system.max_media_attachments,
"characters_reserved_per_url": 23,
},
"media_attachments": {
@ -102,7 +102,7 @@ def instance_info_v2(request) -> dict:
"accounts": {"max_featured_tags": 0},
"statuses": {
"max_characters": Config.system.post_length,
"max_media_attachments": 4,
"max_media_attachments": Config.system.max_media_attachments,
"characters_reserved_per_url": 23,
},
"media_attachments": {

Wyświetl plik

@ -214,6 +214,7 @@ class Config(models.Model):
content_warning_text: str = "Content Warning"
post_length: int = 500
max_media_attachments: int = 4
post_minimum_interval: int = 3 # seconds
identity_min_length: int = 2
identity_max_per_user: int = 5

Wyświetl plik

@ -38,6 +38,10 @@ class BasicSettings(AdminSettingsPage):
"title": "Maximum Post Length",
"help_text": "The maximum number of characters allowed per post",
},
"max_media_attachments": {
"title": "Maximum Media Attachments",
"help_text": "The maximum number of media attachments allowed per post.\nA value other than 4 may be unsupported by clients.",
},
"post_minimum_interval": {
"title": "Minimum Posting Interval",
"help_text": "The minimum number of seconds a user must wait between posts",
@ -129,6 +133,7 @@ class BasicSettings(AdminSettingsPage):
],
"Posts": [
"post_length",
"max_media_attachments",
"post_minimum_interval",
"content_warning_text",
"hashtag_unreviewed_are_public",