about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorJames <james.vogon@gmail.com>2017-08-31 06:44:00 -0700
committerEugen Rochko <eugen@zeonfederated.com>2017-08-31 15:44:00 +0200
commit6b2be5dbfb73e2daf78cf050e5f24c2a8b31ece5 (patch)
tree16b81ff04198a44641f0814f686e1856ab96d4d7 /app/services
parent69957ed10a4b7987fd50351da89944b146952b33 (diff)
Guarantee Subscription service first account has proper URL details (#4732)
* Guarantee Subscription service first account has proper URL details

Subscription Service potentially could break if the first user suspended
themselves, creating a situation where the urls that populate throughout
subscription service's PuSH request would cause the remote API to throw 503 errors.

Guaranteeing that the first account picked is not suspended prevents this problem.

* Fix style issue
Diffstat (limited to 'app/services')
-rw-r--r--app/services/subscribe_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/subscribe_service.rb b/app/services/subscribe_service.rb
index 5617f98f4..bfa7ff8c8 100644
--- a/app/services/subscribe_service.rb
+++ b/app/services/subscribe_service.rb
@@ -42,7 +42,7 @@ class SubscribeService < BaseService
   end
 
   def some_local_account
-    @some_local_account ||= Account.local.first
+    @some_local_account ||= Account.local.where(suspended: false).first
   end
 
   # Any response in the 3xx or 4xx range, except for 429 (rate limit)