Skip to content

Commit

Permalink
Fix adding attribute to user
Browse files Browse the repository at this point in the history
  • Loading branch information
ya7on authored and eugulixes committed May 16, 2019
1 parent fbeb283 commit 32a4436
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/routes/leave/leaveStart.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ module.exports = async function (msg) {

if (msg.match[2]) { // @username хочет в отпуск
const admin = await routines.findUserByName(msg.robot, msg.message.user.name)
admin.vivaLasVegas = admin.vivaLasVegas || {}
admin.vivaLasVegas.allocation = username

if (!await routines.isAdmin(msg.robot, admin.name)) {
msg.send(vars.ACCESS_DENIED_MSG)
return
}

admin.vivaLasVegas = admin.vivaLasVegas || {}
admin.vivaLasVegas.allocation = username
}

if (state.n !== undefined && state.n !== vars.INIT_STATE && state.n < vars.CONFIRM_STATE) {
Expand Down

0 comments on commit 32a4436

Please sign in to comment.