Skip to content

Commit

Permalink
Remove redundant argument
Browse files Browse the repository at this point in the history
And rename a var while we are at it.
  • Loading branch information
sauloperez committed Mar 31, 2021
1 parent d55c59a commit e95288a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/decidim/direct_verifications/authorize_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ def initialize(email, data, session, organization, instrumenter)
end

def call
u = find_user(email)
user = find_user

if u
auth = authorization(u)
if user
auth = authorization(user)
auth.metadata = data

return unless !auth.granted? || auth.expired?

Verification::ConfirmUserAuthorization.call(auth, authorize_form(u), session) do
Verification::ConfirmUserAuthorization.call(auth, authorize_form(user), session) do
on(:ok) do
instrumenter.add_processed :authorized, email
end
Expand All @@ -37,7 +37,7 @@ def call

attr_reader :email, :data, :session, :organization, :instrumenter

def find_user(email)
def find_user
User.find_by(email: email, decidim_organization_id: organization.id)
end

Expand Down

0 comments on commit e95288a

Please sign in to comment.