aboutsummaryrefslogtreecommitdiffstats
path: root/modules/auth/repo_form.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/auth/repo_form.go')
-rw-r--r--modules/auth/repo_form.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go
index d205a6fd53..3c7940afce 100644
--- a/modules/auth/repo_form.go
+++ b/modules/auth/repo_form.go
@@ -402,6 +402,14 @@ func (f SubmitReviewForm) ReviewType() models.ReviewType {
}
}
+// HasEmptyContent checks if the content of the review form is empty.
+func (f SubmitReviewForm) HasEmptyContent() bool {
+ reviewType := f.ReviewType()
+
+ return (reviewType == models.ReviewTypeComment || reviewType == models.ReviewTypeReject) &&
+ len(strings.TrimSpace(f.Content)) == 0
+}
+
// __________ .__
// \______ \ ____ | | ____ _____ ______ ____
// | _// __ \| | _/ __ \\__ \ / ___// __ \