mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
release lock after each error
This commit is contained in:
parent
6389697bd6
commit
29479bafec
@ -560,15 +560,18 @@ export class ContributionResolver {
|
||||
const contribution = await DbContribution.findOne(id)
|
||||
if (!contribution) {
|
||||
logger.error(`Contribution not found for given id: ${id}`)
|
||||
releaseLock()
|
||||
throw new Error('Contribution not found to given id.')
|
||||
}
|
||||
if (contribution.confirmedAt) {
|
||||
logger.error(`Contribution already confirmd: ${id}`)
|
||||
releaseLock()
|
||||
throw new Error('Contribution already confirmd.')
|
||||
}
|
||||
const moderatorUser = getUser(context)
|
||||
if (moderatorUser.id === contribution.userId) {
|
||||
logger.error('Moderator can not confirm own contribution')
|
||||
releaseLock()
|
||||
throw new Error('Moderator can not confirm own contribution')
|
||||
}
|
||||
const user = await DbUser.findOneOrFail(
|
||||
@ -577,6 +580,7 @@ export class ContributionResolver {
|
||||
)
|
||||
if (user.deletedAt) {
|
||||
logger.error('This user was deleted. Cannot confirm a contribution.')
|
||||
releaseLock()
|
||||
throw new Error('This user was deleted. Cannot confirm a contribution.')
|
||||
}
|
||||
const creations = await getUserCreation(contribution.userId, clientTimezoneOffset, false)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user