aboutsummaryrefslogtreecommitdiffstats
path: root/models/user
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2021-11-18 18:42:27 +0100
committerGitHub <noreply@github.com>2021-11-19 01:42:27 +0800
commitf34151bdb22c8160b0a6eafef20725ebae1768da (patch)
tree2abcc5845e4a9cf3769deb27ba5a3ecccd2ad8c9 /models/user
parent55be5fe3399d18b7d2477519707aecf5f99f1de5 (diff)
downloadgitea-f34151bdb22c8160b0a6eafef20725ebae1768da.tar.gz
gitea-f34151bdb22c8160b0a6eafef20725ebae1768da.zip
Move user/org deletion to services (#17673)
Diffstat (limited to 'models/user')
-rw-r--r--models/user/email_address.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/models/user/email_address.go b/models/user/email_address.go
index 74fb71d454..98cd14a6a5 100644
--- a/models/user/email_address.go
+++ b/models/user/email_address.go
@@ -267,3 +267,11 @@ func DeleteEmailAddresses(emails []*EmailAddress) (err error) {
return nil
}
+
+// DeleteInactiveEmailAddresses deletes inactive email addresses
+func DeleteInactiveEmailAddresses(ctx context.Context) error {
+ _, err := db.GetEngine(ctx).
+ Where("is_activated = ?", false).
+ Delete(new(EmailAddress))
+ return err
+}