Remove unused (removed) roles from Your Data / Export

This commit is contained in:
Karina Kwiatek 2020-04-25 21:14:26 +01:00
parent 71e62dddcf
commit 9d933c933e
3 changed files with 5 additions and 102 deletions

View File

@ -227,66 +227,6 @@ namespace :justask do
puts "#{user.screen_name} is no longer banned." puts "#{user.screen_name} is no longer banned."
end end
desc "Gives blogger status to an user."
task :blog, [:screen_name] => :environment do |t, args|
fail "screen name required" if args[:screen_name].nil?
user = User.find_by_screen_name(args[:screen_name])
fail "user #{args[:screen_name]} not found" if user.nil?
user.blogger = true
user.save!
puts "#{user.screen_name} is now a blogger."
end
desc "Removes blogger status from an user."
task :unblog, [:screen_name] => :environment do |t, args|
fail "screen name required" if args[:screen_name].nil?
user = User.find_by_screen_name(args[:screen_name])
fail "user #{args[:screen_name]} not found" if user.nil?
user.blogger = false
user.save!
puts "#{user.screen_name} is no longer a blogger."
end
desc "Gives supporter status to an user."
task :sup, [:screen_name] => :environment do |t, args|
fail "screen name required" if args[:screen_name].nil?
user = User.find_by_screen_name(args[:screen_name])
fail "user #{args[:screen_name]} not found" if user.nil?
user.supporter = true
user.save!
puts "#{user.screen_name} is now an supporter."
end
desc "Removes supporter status from an user."
task :desup, [:screen_name] => :environment do |t, args|
fail "screen name required" if args[:screen_name].nil?
user = User.find_by_screen_name(args[:screen_name])
fail "user #{args[:screen_name]} not found" if user.nil?
user.supporter = false
user.save!
puts "#{user.screen_name} is no longer an supporter."
end
desc "Gives contributor status to an user."
task :contrib, [:screen_name] => :environment do |t, args|
fail "screen name required" if args[:screen_name].nil?
user = User.find_by_screen_name(args[:screen_name])
fail "user #{args[:screen_name]} not found" if user.nil?
user.contributor = true
user.save!
puts "#{user.screen_name} is now a contributor."
end
desc "Removes contributor status from an user."
task :decontrib, [:screen_name] => :environment do |t, args|
fail "screen name required" if args[:screen_name].nil?
user = User.find_by_screen_name(args[:screen_name])
fail "user #{args[:screen_name]} not found" if user.nil?
user.contributor = false
user.save!
puts "#{user.screen_name} is no longer a contributor."
end
desc "Lists all users." desc "Lists all users."
task lusers: :environment do task lusers: :environment do
User.all.each do |u| User.all.each do |u|

View File

@ -111,41 +111,6 @@
%span.label.label-danger %span.label.label-danger
%i.fa.fa-fw.fa-close %i.fa.fa-fw.fa-close
%p.data-heading Supporter
%p
- if current_user.supporter?
%span.label.label-success
%i.fa.fa-fw.fa-check
- else
%span.label.label-danger
%i.fa.fa-fw.fa-close
%p.data-heading Contributor
%p
- if current_user.contributor?
%span.label.label-success
%i.fa.fa-fw.fa-check
- else
%span.label.label-danger
%i.fa.fa-fw.fa-close
%p.data-heading Blogger
%p
- if current_user.blogger?
%span.label.label-success
%i.fa.fa-fw.fa-check
- else
%span.label.label-danger
%i.fa.fa-fw.fa-close
%p.data-heading Translator
%p
- if current_user.translator?
%span.label.label-success
%i.fa.fa-fw.fa-check
- else
%span.label.label-danger
%i.fa.fa-fw.fa-close
.row .row
.col-md-6.col-sm-6.col-xs-12 .col-md-6.col-sm-6.col-xs-12
%h3 IP %h3 IP

View File

@ -34,15 +34,14 @@ class Exporter
private private
def collect_user_info def collect_user_info
%i(answered_count asked_count ban_reason banned_until bio blogger comment_smiled_count commented_count %i(answered_count asked_count ban_reason banned_until bio comment_smiled_count commented_count
confirmation_sent_at confirmed_at contributor created_at crop_h crop_h_h crop_h_w crop_h_x crop_h_y confirmation_sent_at confirmed_at created_at crop_h crop_h_h crop_h_w crop_h_x crop_h_y
crop_w crop_x crop_y current_sign_in_at current_sign_in_ip display_name email follower_count friend_count crop_w crop_x crop_y current_sign_in_at current_sign_in_ip display_name email follower_count friend_count
id last_sign_in_at last_sign_in_ip locale location motivation_header permanently_banned id last_sign_in_at last_sign_in_ip locale location motivation_header permanently_banned
privacy_allow_anonymous_questions privacy_allow_public_timeline privacy_allow_stranger_answers privacy_allow_anonymous_questions privacy_allow_public_timeline privacy_allow_stranger_answers
privacy_show_in_search profile_header_content_type profile_header_file_name profile_header_file_size privacy_show_in_search profile_header_content_type profile_header_file_name profile_header_file_size
profile_header_updated_at profile_picture_content_type profile_picture_file_name profile_picture_file_size profile_header_updated_at profile_picture_content_type profile_picture_file_name profile_picture_file_size
profile_picture_updated_at screen_name show_foreign_themes sign_in_count smiled_count supporter translator profile_picture_updated_at screen_name show_foreign_themes sign_in_count smiled_count updated_at website).each do |f|
updated_at website).each do |f|
@obj[f] = @user.send f @obj[f] = @user.send f
end end
@ -229,9 +228,8 @@ class Exporter
def user_stub(user) def user_stub(user)
uobj = {} uobj = {}
%i(answered_count asked_count bio blogger comment_smiled_count commented_count contributor created_at %i(answered_count asked_count bio comment_smiled_count commented_count created_at display_name follower_count
display_name follower_count friend_count id location motivation_header permanently_banned screen_name friend_count id location motivation_header permanently_banned screen_name smiled_count website).each do |f|
smiled_count supporter translator website).each do |f|
uobj[f] = user.send f uobj[f] = user.send f
end end