Skip to content

Commit

Permalink
Merge pull request #1961 from NMDSdevopsServiceAdm/hotfix/cqcsharing
Browse files Browse the repository at this point in the history
CQC Sharing permission defect (#1959)
  • Loading branch information
paulcarvell authored Feb 7, 2020
2 parents ee0bc35 + a81acd8 commit b6db961
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/models/classes/establishment.js
Original file line number Diff line number Diff line change
Expand Up @@ -914,9 +914,12 @@ class Establishment extends EntityValidator {
// the saving of an Establishment can be initiated within
// an external transaction
const thisTransaction = externalTransaction || t;

// now append the extendable properties
const modifedUpdateDocument = this._properties.save(savedBy.toLowerCase(), {});
if(modifedUpdateDocument && !modifedUpdateDocument.ShareDataValue){
modifedUpdateDocument.shareWithCQC = false;
modifedUpdateDocument.shareWithLA = false;
}

// note - if the establishment was created online, but then updated via bulk upload, the source become bulk and vice-versa.
const updateDocument = {
Expand Down

0 comments on commit b6db961

Please sign in to comment.