Make sure to properly load the entries for the last day

This commit is contained in:
Joseph Schorr 2013-12-09 21:13:21 -05:00
parent 93dec70fe7
commit 6cc0482bfb
3 changed files with 5 additions and 4 deletions

View file

@ -1070,7 +1070,7 @@ def list_logs(user_or_organization_name, start_time, end_time, performer = None,
return joined.where(
User.username == user_or_organization_name,
LogEntry.datetime >= start_time,
LogEntry.datetime <= end_time).order_by(LogEntry.datetime.desc())
LogEntry.datetime < end_time).order_by(LogEntry.datetime.desc())
def log_action(kind_name, user_or_organization_name, performer=None, repository=None,
access_token=None, ip=None, metadata={}, timestamp=None):

View file

@ -1773,7 +1773,7 @@ def get_logs(namespace, start_time, end_time, performer_name=None, repository=No
if start_time:
try:
start_time = datetime.strptime(start_time, '%m/%d/%Y')
start_time = datetime.strptime(start_time + ' UTC', '%m/%d/%Y %Z')
except ValueError:
start_time = None
@ -1782,7 +1782,8 @@ def get_logs(namespace, start_time, end_time, performer_name=None, repository=No
if end_time:
try:
end_time = datetime.strptime(end_time, '%m/%d/%Y')
end_time = datetime.strptime(end_time + ' UTC', '%m/%d/%Y %Z')
end_time = end_time + timedelta(days=1)
except ValueError:
end_time = None

View file

@ -788,7 +788,7 @@ quayApp.directive('logsView', function () {
}
var twoWeeksAgo = getOffsetDate($scope.logEndDate, -14);
if ($scope.logStartDate >= $scope.logEndDate || $scope.logStartDate < twoWeeksAgo) {
if ($scope.logStartDate > $scope.logEndDate || $scope.logStartDate < twoWeeksAgo) {
$scope.logStartDate = twoWeeksAgo;
}