mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 08:02:36 +09:00 
			
		
		
		
	Prevent double-close of issues (#6233)
This commit is contained in:
		@@ -699,8 +699,14 @@ func UpdateIssueCols(issue *Issue, cols ...string) error {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (issue *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (err error) {
 | 
					func (issue *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (err error) {
 | 
				
			||||||
 | 
						// Reload the issue
 | 
				
			||||||
 | 
						currentIssue, err := getIssueByID(e, issue.ID)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Nothing should be performed if current status is same as target status
 | 
						// Nothing should be performed if current status is same as target status
 | 
				
			||||||
	if issue.IsClosed == isClosed {
 | 
						if currentIssue.IsClosed == isClosed {
 | 
				
			||||||
		return nil
 | 
							return nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user