mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	* deleteIssuesByRepoID: delete related CommentTypeRemoveDependency & CommentTypeAddDependency comments too * Ignore ErrIssueNotExist on comment.LoadDepIssueDetails() * CI.restart()
This commit is contained in:
		@@ -1953,6 +1953,11 @@ func deleteIssuesByRepoID(sess Engine, repoID int64) (attachmentPaths []string,
 | 
				
			|||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if _, err = sess.In("dependent_issue_id", deleteCond).
 | 
				
			||||||
 | 
							Delete(&Comment{}); err != nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	var attachments []*Attachment
 | 
						var attachments []*Attachment
 | 
				
			||||||
	if err = sess.In("issue_id", deleteCond).
 | 
						if err = sess.In("issue_id", deleteCond).
 | 
				
			||||||
		Find(&attachments); err != nil {
 | 
							Find(&attachments); err != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -969,9 +969,11 @@ func ViewIssue(ctx *context.Context) {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
		} else if comment.Type == models.CommentTypeRemoveDependency || comment.Type == models.CommentTypeAddDependency {
 | 
							} else if comment.Type == models.CommentTypeRemoveDependency || comment.Type == models.CommentTypeAddDependency {
 | 
				
			||||||
			if err = comment.LoadDepIssueDetails(); err != nil {
 | 
								if err = comment.LoadDepIssueDetails(); err != nil {
 | 
				
			||||||
 | 
									if !models.IsErrIssueNotExist(err) {
 | 
				
			||||||
					ctx.ServerError("LoadDepIssueDetails", err)
 | 
										ctx.ServerError("LoadDepIssueDetails", err)
 | 
				
			||||||
					return
 | 
										return
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		} else if comment.Type == models.CommentTypeCode || comment.Type == models.CommentTypeReview {
 | 
							} else if comment.Type == models.CommentTypeCode || comment.Type == models.CommentTypeReview {
 | 
				
			||||||
			comment.RenderedContent = string(markdown.Render([]byte(comment.Content), ctx.Repo.RepoLink,
 | 
								comment.RenderedContent = string(markdown.Render([]byte(comment.Content), ctx.Repo.RepoLink,
 | 
				
			||||||
				ctx.Repo.Repository.ComposeMetas()))
 | 
									ctx.Repo.Repository.ComposeMetas()))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user