mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
prevent som 500s
This commit is contained in:
@@ -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?
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user