Skip to content

Commit

Permalink
fix: half signup 422 error (#555)
Browse files Browse the repository at this point in the history
* fix: Bump half signup to fix 422 errors

* fix: Print SQL requests on debug mode

* chore: Log SQL request in debug mode

* fix: Review your vote button
  • Loading branch information
Quentinchampenois authored Jun 11, 2024
1 parent 21c5608 commit 5e85db6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ GIT

GIT
remote: https://github.com/OpenSourcePolitics/decidim-module-half_sign_up.git
revision: 5f24e2cd183767e48c390b0fc2064c5544f60c49
revision: 661bfe02e51d1cd4f16df1eb483d932494d5df1f
branch: feature/half_signup_and_budgets_booth
specs:
decidim-half_signup (0.27.0)
Expand All @@ -63,7 +63,7 @@ GIT

GIT
remote: https://github.com/OpenSourcePolitics/decidim-module-ptp.git
revision: 31516827c0836410e5efa1d7e1f93074d86ca201
revision: 32b0f9a29499768cf6783a0026badaed33f025ab
specs:
decidim-budgets_booth (0.27.0)
decidim-budgets (~> 0.27.0)
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ run: up
@make create-seeds

up:
docker-compose -f docker-compose.local.yml up --build -d
docker build . -f Dockerfile.local -t decidim-app-app:latest
docker build . -f Dockerfile.local -t decidim-app-sidekiq:latest
docker-compose -f docker-compose.local.yml up -d
@make setup-database

# Stops containers and remove volumes
Expand Down
2 changes: 2 additions & 0 deletions app/services/decidim/sms_gateway_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class SmsGatewayService
attr_reader :mobile_phone_number, :code

def initialize(mobile_phone_number, code, sms_gateway_context = {})
Rails.logger.debug { "#{mobile_phone_number} - #{code}" }

@mobile_phone_number = mobile_phone_number
@code = code
@organization_name = sms_gateway_context[:organization]&.name
Expand Down
4 changes: 4 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
# The available log levels are: :debug, :info, :warn, :error, :fatal, and :unknown
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "warn").to_sym

# Highlight code that triggered database queries in logs.
# Display SQL requests for local docker production mode
config.active_record.verbose_query_logs = ENV.fetch("RAILS_LOG_LEVEL", "warn") == "debug"

# Prepend all log lines with the following tags.
config.log_tags = [:request_id]

Expand Down
2 changes: 2 additions & 0 deletions config/initializers/half_signup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
config.show_tos_page_after_signup = Rails.application.secrets.dig(:decidim, :half_signup, :show_tos_page_after_signup)
config.auth_code_length = 4
config.default_countries = ENV.fetch("AVAILABLE_LOCALES", "fr").split(",").map(&:to_sym)

config.skip_csrf = ENV.fetch("HALF_SIGNUP_SKIP_CSRF", "false") == "true"
end

0 comments on commit 5e85db6

Please sign in to comment.