mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
fix: allow_public_stats_lookup was ignored (#545)
This commit is contained in:
@@ -34,6 +34,10 @@ 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?
|
||||
|
||||
Reference in New Issue
Block a user