aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/video-channel.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/video-channel.ts')
-rw-r--r--server/controllers/api/video-channel.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts
index d7c92952a..5b9fb794a 100644
--- a/server/controllers/api/video-channel.ts
+++ b/server/controllers/api/video-channel.ts
@@ -273,7 +273,6 @@ async function addVideoChannel (req: express.Request, res: express.Response) {
273 273
274async function updateVideoChannel (req: express.Request, res: express.Response) { 274async function updateVideoChannel (req: express.Request, res: express.Response) {
275 const videoChannelInstance = res.locals.videoChannel 275 const videoChannelInstance = res.locals.videoChannel
276 const videoChannelFieldsSave = videoChannelInstance.toJSON()
277 const oldVideoChannelAuditKeys = new VideoChannelAuditView(videoChannelInstance.toFormattedJSON()) 276 const oldVideoChannelAuditKeys = new VideoChannelAuditView(videoChannelInstance.toFormattedJSON())
278 const videoChannelInfoToUpdate = req.body as VideoChannelUpdate 277 const videoChannelInfoToUpdate = req.body as VideoChannelUpdate
279 let doBulkVideoUpdate = false 278 let doBulkVideoUpdate = false
@@ -309,10 +308,9 @@ async function updateVideoChannel (req: express.Request, res: express.Response)
309 } catch (err) { 308 } catch (err) {
310 logger.debug('Cannot update the video channel.', { err }) 309 logger.debug('Cannot update the video channel.', { err })
311 310
312 // Force fields we want to update
313 // If the transaction is retried, sequelize will think the object has not changed 311 // If the transaction is retried, sequelize will think the object has not changed
314 // So it will skip the SQL request, even if the last one was ROLLBACKed! 312 // So we need to restore the previous fields
315 resetSequelizeInstance(videoChannelInstance, videoChannelFieldsSave) 313 resetSequelizeInstance(videoChannelInstance)
316 314
317 throw err 315 throw err
318 } 316 }