prevent som 500s

This commit is contained in:
Echo
2025-06-16 14:34:16 -04:00
parent 84e92cc844
commit 2831a5670e
2 changed files with 2 additions and 7 deletions

View File

@@ -34,10 +34,6 @@ class Api::V1::StatsController < ApplicationController
return render json: { error: "User not found" }, status: :not_found unless @user.present?
if !@user.allow_public_stats_lookup && (!current_user || current_user != @user)
return render json: { error: "user has disabled public stats" }, status: :forbidden
end
start_date = params[:start_date].to_datetime if params[:start_date].present?
start_date ||= 10.years.ago
end_date = params[:end_date].to_datetime if params[:end_date].present?

View File

@@ -14,9 +14,9 @@ development:
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
url: <%= ENV['DATABASE_URL'] %>
url: <%= ENV['PROD_DATABASE_URL'] %>
primary_direct:
url: <%= ENV['DATABASE_URL'] %>
url: <%= ENV['PROD_DATABASE_URL'] %>
adapter: postgresql
encoding: unicode
database_tasks: false
@@ -72,7 +72,6 @@ test:
password: postgres
replica: true
# Store production database in the storage/ directory, which by default
# is mounted as a persistent Docker volume in config/deploy.yml.
production: