about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorAndrew <andrewLchronister@gmail.com>2017-04-15 04:17:07 -0700
committerEugen <eugen@zeonfederated.com>2017-04-15 13:17:07 +0200
commite28a5aab087cf674d8f910e6b6ad2526dbd9f7f2 (patch)
tree4eb80ae5b678c6353aaa55e4920cd28f91d3c50d /lib
parentf9d7ec89711e29a7c1fdf060abf9599b65c9f515 (diff)
Add tasks for open/close registration (#1823)
* Add tasks for open/close registration

* Code climate style fix

* Use true instead of string 'true'
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/mastodon.rake16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake
index 4761b2919..15b423745 100644
--- a/lib/tasks/mastodon.rake
+++ b/lib/tasks/mastodon.rake
@@ -82,6 +82,22 @@ namespace :mastodon do
     end
   end
 
+  namespace :settings do
+    desc 'Open registrations on this instance'
+    task open_registrations: :environment do
+      setting = Setting.where(var: 'open_registrations').first
+      setting.value = true
+      setting.save
+    end
+
+    desc 'Close registrations on this instance'
+    task close_registrations: :environment do
+      setting = Setting.where(var: 'open_registrations').first
+      setting.value = false
+      setting.save
+    end
+  end
+
   namespace :maintenance do
     desc 'Update counter caches'
     task update_counter_caches: :environment do