From a2370fc17be70367848e4514634b2b55257b77e7 Mon Sep 17 00:00:00 2001 From: hellekin Date: Thu, 26 Mar 2020 20:18:56 +0100 Subject: [PATCH 1/2] fix site_setting disable_emails arguments API changed from boolean to enum: now you can use 'yes' (instead of true), 'no' (instead of false), and 'non-staff' to forbid Discourse from sending emails except for Staff. --- responses/admin/site_settings.json | 20 +++++++++++++++++--- swagger.json | 11 ++++++++--- swagger.yml | 9 ++++++--- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/responses/admin/site_settings.json b/responses/admin/site_settings.json index 44a00c9..cf5b43c 100644 --- a/responses/admin/site_settings.json +++ b/responses/admin/site_settings.json @@ -2342,10 +2342,24 @@ "setting": "disable_emails", "description": "Prevent Discourse from sending any kind of emails", "default": "false", - "type": "bool", - "value": "false", + "type": "enum", + "value": "yes", "category": "email", - "preview": null + "preview": null, + "valid_values": [ + { + "name": "yes", + "value": "yes" + }, + { + "name": "no", + "value": "no" + }, + { + "name": "non-staff", + "value": "non-staff" + } + ] }, { "setting": "strip_images_from_short_emails", diff --git a/swagger.json b/swagger.json index 0916ec0..caa07f3 100644 --- a/swagger.json +++ b/swagger.json @@ -13478,8 +13478,13 @@ ], "properties": { "disable_emails": { - "type": "boolean", - "example": false, + "type": "string", + "enum": [ + "yes", + "no", + "non-staff" + ], + "example": "yes", "description": "Prevent Discourse from sending any kind of emails\n" } } @@ -14999,7 +15004,7 @@ "automatically_download_gravatars": { "type": "boolean", "example": true, - "description": "\"Download Gravatars for users upon account creation or email change.\"\n" + "description": "" } } } diff --git a/swagger.yml b/swagger.yml index 8b3582e..1074b68 100644 --- a/swagger.yml +++ b/swagger.yml @@ -6055,8 +6055,12 @@ paths: - disable_emails properties: disable_emails: - type: boolean - example: false + type: string + enum: + - yes + - no + - non-staff + example: "yes" description: | Prevent Discourse from sending any kind of emails responses: @@ -7125,7 +7129,6 @@ paths: type: boolean example: true description: | - "Download Gravatars for users upon account creation or email change." responses: '200': description: | From 93bf911e079a50eca02ece50b75dd09514a28541 Mon Sep 17 00:00:00 2001 From: hellekin Date: Mon, 30 Mar 2020 15:26:03 +0200 Subject: [PATCH 2/2] Restore description for `automatically_download_gravatars` --- swagger.json | 2 +- swagger.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/swagger.json b/swagger.json index caa07f3..4ee072a 100644 --- a/swagger.json +++ b/swagger.json @@ -15004,7 +15004,7 @@ "automatically_download_gravatars": { "type": "boolean", "example": true, - "description": "" + "description": "\"Download Gravatars for users upon account creation or email change.\"\n" } } } diff --git a/swagger.yml b/swagger.yml index 1074b68..3262f11 100644 --- a/swagger.yml +++ b/swagger.yml @@ -7129,6 +7129,7 @@ paths: type: boolean example: true description: | + "Download Gravatars for users upon account creation or email change." responses: '200': description: |