From 3fa94b579d0b001022b2a845a57ad0551f2b0d3a Mon Sep 17 00:00:00 2001 From: Nazar Gargol Date: Tue, 25 Aug 2020 18:49:53 +1200 Subject: [PATCH] Removed date handling validation in members importer logic no issue - This is handled on input sanitization layer with date format check in JSON schema validation, so there's no need to do this check again in the importer. --- ghost/members-importer/lib/index.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/ghost/members-importer/lib/index.js b/ghost/members-importer/lib/index.js index 9bc69177c8..07c396b219 100644 --- a/ghost/members-importer/lib/index.js +++ b/ghost/members-importer/lib/index.js @@ -247,17 +247,6 @@ function getMemberData({members, allLabelModels, importSetLabels, createdBy}) { let createdAt = member.created_at === '' ? undefined : member.created_at; if (createdAt) { - const date = new Date(createdAt); - - // CASE: client sends `0000-00-00 00:00:00` - if (isNaN(date)) { - // TODO: throw in validation stage for single record, not whole batch! - throw new errors.ValidationError({ - message: i18n.t('errors.models.base.invalidDate', {key: 'created_at'}), - code: 'DATE_INVALID' - }); - } - createdAt = moment(createdAt).toDate(); } else { createdAt = new Date();