app: remove :instructeur_bypass_email_login_token from Flipper

This commit is contained in:
Pierre de La Morinerie 2021-11-25 14:50:23 +00:00
parent 8b3d31980a
commit d524beee4e
3 changed files with 2 additions and 21 deletions

View file

@ -1,23 +1,5 @@
module Manager
class InstructeursController < Manager::ApplicationController
# Temporary code: synchronize Flipper's instructeur_bypass_email_login_token
# when Instructeur.bypass_email_login_token is modified.
#
# This will be removed when the migration of this feature flag out of Flipper will be complete.
def update
super
instructeur = requested_resource
saved_successfully = !requested_resource.changed?
if saved_successfully
if instructeur.bypass_email_login_token
Flipper.enable_actor(:instructeur_bypass_email_login_token, instructeur.user)
else
Flipper.disable_actor(:instructeur_bypass_email_login_token, instructeur.user)
end
end
end
def reinvite
instructeur = Instructeur.find(params[:id])
instructeur.user.invite!

View file

@ -63,8 +63,8 @@ module TPS
end
config.middleware.use Rack::Attack
config.middleware.use Flipper::Middleware::Memoizer,
preload: [:instructeur_bypass_email_login_token]
# Ensure we make maximum one call per feature per request.
config.middleware.use Flipper::Middleware::Memoizer
config.ds_env = ENV.fetch('DS_ENV', Rails.env)

View file

@ -30,7 +30,6 @@ features = [
:dossier_pdf_vide,
:expert_not_allowed_to_invite,
:hide_instructeur_email,
:instructeur_bypass_email_login_token,
:procedure_revisions,
:procedure_routage_api,
:procedure_process_expired_dossiers_termine