Support Forum
#supportforum Any doubts or questions on how to use Decidim? Check them with the Community!
Error 500 en CensusAuthorizationHandler
Hi, has someone had the following error -> 500 error while adding auctions. The steps performed are:
I add in the file -> config / initializers / decidim.rb
Decidim :: Verifications.register_workflow (: census_authorization_handler) do | ath | auth.form = "CensusAuthorizationHandler" end
Thus I obtain the authorization of the authorization from the Administration.
Then I add the form in app / views / census_authorization / _form.html.erb
And finally -> app / services / census_authorization_handler.rb
The error I get when doing Submit on the form -> is error 500, the error log does not give any clue of the reason for the error.
Regardless of what I write to the census_authorization_handler.rb file, I always get the same error.
Decidim Version: 0.22
If you can help me with any ideas of what the problem might be, I will greatly appreciate it .
List of Endorsements
Report inappropriate content
Is this content inappropriate?
6 comments
Hello Ivanna, can you past a gist with the traceback log?
Conversation with Ivana Seimandi
Hello!! I managed to remove the 500 error, now the authorization works for me. What happens to me now is that it authorizes me to "All" the number of documents that I enter.
Help me by describing the following code? I can't understand what
def response
return nil if document_number.blank?
return @response if defined?(@response)
response ||= Faraday.post Rails.application.secrets.census_url do |request|
request.headers["Content-Type"] = "text/xml"
request.body = request_body
@response ||= Nokogiri::XML(response.bod end
@response ||= Nokogiri::XML(response.body).remove_namespaces!
end
I check if the entered document number exists in the DB through WS Rest, my ws always responds 200, I must analyze the content and if idpersona = 0 it means that it does not exist in the database so I must not authorize it. I do not know how to take that value and how to respond so that the authorization does not take place.
Any clue you can give me will do!
Thanks!
Hola Ivana, como hiciste para resolver el error 500?
Estoy con el mismo problema y no le hallo solución. Con respecto al código, no tengo conocimientos en el lenguaje, pero deberías verificar en todo caso como funciona la primera condición. Por lo que deduzco, verifica si el documento está en blanco?
Saludos.
Hola! hice varias cosas, pero comenzó a funcionar luego de comentar en Gemfile la gema decidim-verifications e instalar "Yarn". Saludos.
Muchas gracias Ivana.
Sabes que no hice ninguna modificación aún porque encontré la opción para subir el censo en la barra lateral izquierda como "Subir Censo", de la página de administración del sitio. Realicé algunas pruebas y por el momento funciona bien y verifica bien los documentos. El error 500 me aparece únicamente si intento acceder a través de la opción Participantes>Verificaciones.
Saludos.
Hola! para solucionar el error 500 que tenía probé varias cosas, pero comenzó a funcionar cuando en gemfile comentamos la gema decidim-verifications e instalamos "Yarn".
Add your comment
Sign in with your account or sign up to add your comment.
Loading comments ...