Skip to content

Commit 21d8c56

Browse files
Modify date range validation to allow equal start and end dates
1 parent 185f5ff commit 21d8c56

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sentry/api/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ def get_date_range_from_stats_period(
218218
start = get_datetime_from_stats_period(stats_period, now)
219219

220220
elif stats_period_start or stats_period_end:
221+
221222
if not stats_period_start or not stats_period_end:
222223
raise InvalidParams("statsPeriodStart and statsPeriodEnd are both required")
223224
start = get_datetime_from_stats_period(stats_period_start, now)
@@ -234,7 +235,7 @@ def get_date_range_from_stats_period(
234235
elif optional:
235236
return None, None
236237

237-
if start >= end:
238+
if start > end:
238239
raise InvalidParams("start must be before end")
239240

240241
return start, end

0 commit comments

Comments
 (0)