Skip to content

Commit ba228b7

Browse files
lunnyAbdulrhmnGhanem
authored andcommitted
improve empty notice (go-gitea#15890)
1 parent c165e8b commit ba228b7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

models/admin.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ func DeleteNotice(id int64) error {
114114

115115
// DeleteNotices deletes all notices with ID from start to end (inclusive).
116116
func DeleteNotices(start, end int64) error {
117+
if start == 0 && end == 0 {
118+
_, err := x.Exec("DELETE FROM notice")
119+
return err
120+
}
121+
117122
sess := x.Where("id >= ?", start)
118123
if end > 0 {
119124
sess.And("id <= ?", end)

0 commit comments

Comments
 (0)