Verification requests should use the writing role
This commit is contained in:
parent
538bcf21c9
commit
4bb2f1b745
|
@ -4,6 +4,8 @@ class Settings::Verifications::ModerationController < Admin::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def approve
|
def approve
|
||||||
|
|
||||||
|
ActiveRecord::Base.connected_to(role: :writing) do
|
||||||
verification_request = AccountVerificationRequest.find(params[:id])
|
verification_request = AccountVerificationRequest.find(params[:id])
|
||||||
|
|
||||||
# Mark user as verified
|
# Mark user as verified
|
||||||
|
@ -11,19 +13,22 @@ class Settings::Verifications::ModerationController < Admin::BaseController
|
||||||
account.is_verified = true
|
account.is_verified = true
|
||||||
account.save()
|
account.save()
|
||||||
|
|
||||||
# Notify user
|
|
||||||
UserMailer.verification_approved(account.user).deliver_later!
|
|
||||||
|
|
||||||
# Remove all traces
|
# Remove all traces
|
||||||
verification_request.destroy()
|
verification_request.destroy()
|
||||||
|
end
|
||||||
|
|
||||||
|
# Notify user
|
||||||
|
UserMailer.verification_approved(account.user).deliver_later!
|
||||||
|
|
||||||
# Redirect back to the form with a proper message
|
# Redirect back to the form with a proper message
|
||||||
redirect_to settings_verifications_moderation_url, notice: I18n.t('verifications.moderation.approved_msg')
|
redirect_to settings_verifications_moderation_url, notice: I18n.t('verifications.moderation.approved_msg')
|
||||||
end
|
end
|
||||||
|
|
||||||
def reject
|
def reject
|
||||||
|
ActiveRecord::Base.connected_to(role: :writing) do
|
||||||
verification_request = AccountVerificationRequest.find(params[:id])
|
verification_request = AccountVerificationRequest.find(params[:id])
|
||||||
verification_request.destroy()
|
verification_request.destroy()
|
||||||
|
end
|
||||||
redirect_to settings_verifications_moderation_url, notice: I18n.t('verifications.moderation.rejected_msg')
|
redirect_to settings_verifications_moderation_url, notice: I18n.t('verifications.moderation.rejected_msg')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue