Commit dc56535a authored by Bruno Freitas Tissei's avatar Bruno Freitas Tissei
Browse files

Fix professional creating, now cep must be valid


Signed-off-by: Bruno Freitas Tissei's avatarBruno Freitas Tissei <bft15@inf.ufpr.br>
parent 32e029eb
...@@ -213,9 +213,9 @@ class ProfessionalsController < ApplicationController ...@@ -213,9 +213,9 @@ class ProfessionalsController < ApplicationController
load_places places_a load_places places_a
if params[:citizen][:cep] if params[:citizen][:cep]
if !valida_cep(params[:citizen][:cep]) if !valida_cep(params[:citizen][:cep])
return redirect_to :back, alert: "CEP inválido." return redirect_to :back, alert: "CEP inválido."
end end
end end
#if params[:role][:name].empty? #if params[:role][:name].empty?
...@@ -833,6 +833,14 @@ end ...@@ -833,6 +833,14 @@ end
@places_add[session[:new_city_hall_service_place_id].to_i] = 'adm_prefeitura' @places_add[session[:new_city_hall_service_place_id].to_i] = 'adm_prefeitura'
end end
if params[:citizen][:cep]
if !valida_cep(params[:citizen][:cep])
return redirect_to :back, alert: "CEP inválido."
end
else
return redirect_to :back, alert: "CEP inválido."
end
@citizen = Citizen.new(citizen_params) @citizen = Citizen.new(citizen_params)
@professional = Professional.new(professional_params) @professional = Professional.new(professional_params)
@citizen.professional = @professional @citizen.professional = @professional
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment