about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-07-26 18:55:33 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-07-26 18:55:33 +0200
commit92569ffde81a3fe768fd8773fdab5d1a927f3f88 (patch)
treed5544ac69ccea9235baf679c1988ff8e811662ef /app/services
parenta6b44401156524ef70a5917d17c93886c5e20a0d (diff)
Fix invites not being disabled upon account suspension (#11412)
* Disable invite links from disabled/suspended users

* Add has_many invites relationship to users

* Destroy unused invites when suspending an account
Diffstat (limited to 'app/services')
-rw-r--r--app/services/suspend_account_service.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/services/suspend_account_service.rb b/app/services/suspend_account_service.rb
index 00cffcdfc..902af376c 100644
--- a/app/services/suspend_account_service.rb
+++ b/app/services/suspend_account_service.rb
@@ -64,6 +64,7 @@ class SuspendAccountService < BaseService
       @account.user.destroy
     else
       @account.user.disable!
+      @account.user.invites.where(uses: 0).destroy_all
     end
   end