mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Do not send notifications for draft releases (#21451)
Fixes #21448 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
		@@ -271,13 +271,12 @@ func UpdateRelease(doer *user_model.User, gitRepo *git.Repository, rel *repo_mod
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if !isCreated {
 | 
			
		||||
		notification.NotifyUpdateRelease(doer, rel)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if !rel.IsDraft {
 | 
			
		||||
		notification.NotifyNewRelease(rel)
 | 
			
		||||
		if isCreated {
 | 
			
		||||
			notification.NotifyNewRelease(rel)
 | 
			
		||||
		} else {
 | 
			
		||||
			notification.NotifyUpdateRelease(doer, rel)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return err
 | 
			
		||||
@@ -353,7 +352,9 @@ func DeleteReleaseByID(ctx context.Context, id int64, doer *user_model.User, del
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	notification.NotifyDeleteRelease(doer, rel)
 | 
			
		||||
	if !rel.IsDraft {
 | 
			
		||||
		notification.NotifyDeleteRelease(doer, rel)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user