Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Commit

Permalink
fix: classical users couldn't save their settings
Browse files Browse the repository at this point in the history
  • Loading branch information
zhakk-harn committed Jun 12, 2018
1 parent 986ea73 commit 8d9bae9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/controllers/settings/changesettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,17 @@ module.exports = function(req, res, redis) {
// This also serves as advanced validation for AWS credentials
if (selectProvidedFields.amazonSimpleEmailServiceAccessKey || selectProvidedFields.amazonSimpleEmailServiceSecretKey || selectProvidedFields.region || selectProvidedFields.email ) {
console.log("AWS settings provided, reconfiguring AWS");
Setting.findOne({
Setting.findOrCreate({
where: { userId: req.user.id },
attributes: ['amazonSimpleEmailServiceAccessKey', 'amazonSimpleEmailServiceSecretKey', 'region', 'email']
attributes: ['amazonSimpleEmailServiceAccessKey', 'amazonSimpleEmailServiceSecretKey', 'region', 'email', 'userId']
}).then(settingInstance => {
const settings = _.extend(
{
amazonSimpleEmailServiceAccessKey: settingInstance.amazonSimpleEmailServiceAccessKey,
amazonSimpleEmailServiceSecretKey: settingInstance.amazonSimpleEmailServiceSecretKey,
region: settingInstance.region,
email: settingInstance.email
email: settingInstance.email,
userId: req.user.id
}, selectProvidedFields);

configureAws({
Expand Down

0 comments on commit 8d9bae9

Please sign in to comment.