Browse Source

Add tasks for open/close registration (#1823)

* Add tasks for open/close registration

* Code climate style fix

* Use true instead of string 'true'
closed-social-glitch-2
Andrew 7 years ago
committed by Eugen
parent
commit
e28a5aab08
1 changed files with 16 additions and 0 deletions
  1. +16
    -0
      lib/tasks/mastodon.rake

+ 16
- 0
lib/tasks/mastodon.rake View File

@ -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

Loading…
Cancel
Save