Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid disabling deck validation with ALL_CARDS_AVAILABLE #268

Merged
merged 1 commit into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions app/ui/models/deck.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -403,7 +402,6 @@ var DeckModel = Backbone.Model.extend({
valid = false;
}
}

this._isValid = valid;

// get searchable content
Expand Down
33 changes: 5 additions & 28 deletions config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down