Skip to content

Commit

Permalink
Some quick fixes for creating a password
Browse files Browse the repository at this point in the history
  • Loading branch information
martijncasteel committed Mar 16, 2016
1 parent b1f786f commit b23581f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions app/controllers/users/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Users::RegistrationsController < Devise::RegistrationsController

# add member to user credentials
def create
build_resource(sign_up_params)
resource = build_resource(sign_up_params)

if User.find_by_email(sign_up_params[:email]).present?
resource = resource_class.send_reset_password_instructions(sign_up_params.slice(:email))
Expand All @@ -19,11 +19,11 @@ def create
resource.credentials = Member.find_by_email(sign_up_params[:email])

if resource.credentials.nil?
set_flash_message :error, :'Ongeldige e-mailadres.'
set_flash_message :notice, :'not_found_in_database'

clean_up_passwords resource
set_minimum_password_length
render 'new'
render 'new' and return
end

resource_saved = resource.save
Expand All @@ -37,7 +37,7 @@ def create
else
clean_up_passwords resource
set_minimum_password_length
render 'new'
render 'new' and return
end
end

Expand Down
4 changes: 2 additions & 2 deletions app/models/ideal_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class IdealTransaction < ActiveRecord::Base
)

if response.code != '200'
logger.error response.inspect
logger.fatal response.inspect
raise ArgumentError
end

Expand Down Expand Up @@ -59,7 +59,7 @@ def self.list( limit, offset )
response = Net::HTTP.get_response( URI("#{ENV['IDEAL_PLATFORM']}/?limit=#{limit}&offset=#{offset}") )

if response.code != '200'
logger.debug response.code
logger.fatal response.inspect
raise ArgumentError
end

Expand Down
5 changes: 3 additions & 2 deletions config/locales/devise.nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ nl:
updated: "Je wachtwoord is succesvol veranderd, je bent nu ingelogd."
updated_not_active: "Je wachtwoord is succesvol veranderd."
registrations:
not_found_in_database: "Ongeldig e-mail of wachtwoord."
destroyed: "Tot ziens! Je account is succesvol verwijderd."
signed_up: "Welkom, u bent succesvol ingelogd"
signed_up_but_inactive: "Je account is nog niet geactiveerd."
signed_up_but_locked: "Je bent succesvol ingelogd, echter kunnen we nog niet inloggen, omdat je account is geblokeerd."
signed_up_but_unconfirmed: "Een e-mail met een bevestigings URL is verstuurd. Gebruik de URL om je account te activeren."
update_needs_confirmation: "Je account is succesvol gewijzigd, echter hebben moet je nog wel je e-mail adres verifiëren."
update_needs_confirmation: "Je account is succesvol gewijzigd, echter moet je nog wel je e-mail adres verifiëren."
updated: "Je account is succesvol gewijzigd"
sessions:
signed_in: "Succesvol ingelogd"
Expand All @@ -54,4 +55,4 @@ nl:
not_locked: "is gelockt"
not_saved:
one: "1 fout zorgde ervoor dat %{resource} niet kon worden opgeslagen:"
other: "%{count} fouten zorgde ervoor dat %{resource} niet kon worden opgeslagen:"
other: "%{count} fouten zorgde ervoor dat %{resource} niet kon worden opgeslagen:"

0 comments on commit b23581f

Please sign in to comment.