From b0d3381a94e78b679cebb9fbf35e82a9d6ae3f6f Mon Sep 17 00:00:00 2001 From: Will Roberts Date: Tue, 17 Jan 2023 12:03:09 -0500 Subject: [PATCH] Avoid disabling deck validation with ALL_CARDS_AVAILABLE --- app/ui/models/deck.js | 4 +--- config/config.js | 33 +++++---------------------------- 2 files changed, 6 insertions(+), 31 deletions(-) diff --git a/app/ui/models/deck.js b/app/ui/models/deck.js index 622f33029..f56e7e4e3 100644 --- a/app/ui/models/deck.js +++ b/app/ui/models/deck.js @@ -392,8 +392,7 @@ var DeckModel = Backbone.Model.extend({ // - any starter deck is valid // - each card is already validated as it is added/removed var valid = true; - - if (!this.get('isStarter') && !process.env.ALL_CARDS_AVAILABLE) { + if (!this.get('isStarter') && !process.env.DISABLE_DECK_VALIDATION) { // when deck is in production if (needsGeneral) { // deck must have a general @@ -403,7 +402,6 @@ var DeckModel = Backbone.Model.extend({ valid = false; } } - this._isValid = valid; // get searchable content diff --git a/config/config.js b/config/config.js index 9e3a2531d..868df952d 100644 --- a/config/config.js +++ b/config/config.js @@ -295,34 +295,11 @@ const config = convict({ default: true, env: 'ALL_CARDS_AVAILABLE', }, - paypalEnvironmentUrl: { - doc: 'Paypal Environment Base URL.', - // format: "url", - default: 'https://sandbox.paypal.com/', - }, - paypalNvpApi: { - username: { - doc: 'Paypal NVP API username.', - default: '', - }, - password: { - doc: 'Paypal NVP API password.', - default: '', - }, - signature: { - doc: 'Paypal NVP API signature.', - default: '', - }, - sandbox: { - doc: 'Use NVP API Sandbox?', - format: Boolean, - default: true, - }, - }, - mailchimpApiKey: { - doc: 'Mailchimp API key', - format: String, - default: '', + disableDeckValidation: { + doc: 'Requires decks to contain exactly 40 cards and 1 general.', + format: Boolean, + default: false, + env: 'DISABLE_DECK_VALIDATION', }, recordClientLogs: { doc: 'Buffer 500 log lines on the client to be able to submit to server.',