projects
/
oweals
/
peertube.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d6bd50b
)
Fix deleting a video with comments
author
Chocobozzz
<me@florianbigard.com>
Tue, 13 Feb 2018 12:35:10 +0000
(13:35 +0100)
committer
Chocobozzz
<me@florianbigard.com>
Tue, 13 Feb 2018 12:35:10 +0000
(13:35 +0100)
server/models/video/video-comment.ts
patch
|
blob
|
history
diff --git
a/server/models/video/video-comment.ts
b/server/models/video/video-comment.ts
index 868d04ff9e0a7b381e78a63d8e05553d309d8001..ab0f05d6e50b3af1875fb755d841c2c33529d558 100644
(file)
--- a/
server/models/video/video-comment.ts
+++ b/
server/models/video/video-comment.ts
@@
-188,6
+188,27
@@
export class VideoCommentModel extends Model<VideoCommentModel> {
}) as AccountModel
}
+ if (!instance.Video) {
+ instance.Video = await instance.$get('Video', {
+ include: [
+ {
+ model: VideoChannelModel,
+ include: [
+ {
+ model: AccountModel,
+ include: [
+ {
+ model: ActorModel
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ transaction: options.transaction
+ }) as VideoModel
+ }
+
if (instance.isOwned()) {
await sendDeleteVideoComment(instance, options.transaction)
}