Skip to content

Commit

Permalink
ES returning dates in iso format so add conversion to avoid type error
Browse files Browse the repository at this point in the history
  • Loading branch information
jingcheng16 authored and mjriley committed Dec 9, 2024
1 parent f38e1c3 commit fcf3c61
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions corehq/apps/builds/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import re
from datetime import datetime

from dimagi.utils.parsing import ISO_DATETIME_FORMAT

from .models import CommCareBuild, CommCareBuildConfig

Expand Down Expand Up @@ -54,6 +57,9 @@ def get_latest_version_at_time(target_time):
if not target_time:
return config.get_default().version

if isinstance(target_time, str):
target_time = datetime.strptime(target_time, ISO_DATETIME_FORMAT)

# Iterate through menu items in reverse (newest to oldest)
for item in reversed(config.menu):
if item.superuser_only:
Expand Down

0 comments on commit fcf3c61

Please sign in to comment.