fix: allow_public_stats_lookup was ignored (#545)

This commit is contained in:
MathiasDPX
2025-11-04 20:49:07 +01:00
committed by GitHub
parent 5f6f195fcf
commit 313f9115fb

View File

@@ -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?