mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 12:13:33 +08:00
Merge branch 'release_21.05' of https://github.com/galaxyproject/galaxy into alex_branch
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
"""
|
||||
API operations on the contents of a history.
|
||||
"""
|
||||
import datetime
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
from datetime import datetime
|
||||
|
||||
import dateutil.parser
|
||||
|
||||
from galaxy import (
|
||||
exceptions,
|
||||
@@ -1082,8 +1084,10 @@ class HistoryContentsController(BaseGalaxyAPIController, UsesLibraryMixinItems,
|
||||
# if it hasn't then we can short-circuit the poll request
|
||||
since = kwd.get('update_time-gt', None)
|
||||
if since:
|
||||
since_str = self.history_contents_filters.parse_date(since)
|
||||
since_date = datetime.fromisoformat(since_str)
|
||||
# sqlalchemy DateTime columns are not timezone aware, so parse `since` into timezone-aware
|
||||
# datetime and then convert to naive datetime object representing UTC,
|
||||
# assuming history.update_time represents UTC time.
|
||||
since_date = dateutil.parser.isoparse(since).astimezone(datetime.timezone.utc).replace(tzinfo=None)
|
||||
if history.update_time <= since_date:
|
||||
trans.response.status = 204
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user