Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🤖 Adjust Date Range Validation #67834

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/sentry/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def get_date_range_from_stats_period(
start = get_datetime_from_stats_period(stats_period, now)

elif stats_period_start or stats_period_end:

if not stats_period_start or not stats_period_end:
raise InvalidParams("statsPeriodStart and statsPeriodEnd are both required")
start = get_datetime_from_stats_period(stats_period_start, now)
Expand All @@ -234,7 +235,7 @@ def get_date_range_from_stats_period(
elif optional:
return None, None

if start >= end:
if start > end:
raise InvalidParams("start must be before end")

return start, end
Expand Down
Loading