comparison src/server/pages.py @ 1109:3a7b2b239d3e

pages: change module for date_parse, following backend change
author Goffi <goffi@goffi.org>
date Thu, 21 Jun 2018 01:19:42 +0200
parents 63ed5f6bd4eb
children 045e8bdaed4f
comparison
equal deleted inserted replaced
1108:7ec1ba86d38d 1109:3a7b2b239d3e
24 from twisted.python import failure 24 from twisted.python import failure
25 25
26 from sat.core.i18n import _ 26 from sat.core.i18n import _
27 from sat.core import exceptions 27 from sat.core import exceptions
28 from sat.tools.common import uri as common_uri 28 from sat.tools.common import uri as common_uri
29 from sat.tools import utils 29 from sat.tools.common import date_utils
30 from sat.core.log import getLogger 30 from sat.core.log import getLogger
31 log = getLogger(__name__) 31 log = getLogger(__name__)
32 from libervia.server.constants import Const as C 32 from libervia.server.constants import Const as C
33 from libervia.server import session_iface 33 from libervia.server import session_iface
34 from libervia.server.utils import quote, SubPage 34 from libervia.server.utils import quote, SubPage
666 if cache.hash == etag_match: 666 if cache.hash == etag_match:
667 self.pageError(request, C.HTTP_NOT_MODIFIED, no_body=True) 667 self.pageError(request, C.HTTP_NOT_MODIFIED, no_body=True)
668 else: 668 else:
669 modified_match = request.getHeader('If-Modified-Since') 669 modified_match = request.getHeader('If-Modified-Since')
670 if modified_match is not None: 670 if modified_match is not None:
671 modified = utils.date_parse(modified_match) 671 modified = date_utils.date_parse(modified_match)
672 if modified >= int(cache.created): 672 if modified >= int(cache.created):
673 self.pageError(request, C.HTTP_NOT_MODIFIED, no_body=True) 673 self.pageError(request, C.HTTP_NOT_MODIFIED, no_body=True)
674 674
675 def checkCacheSubscribeCb(self, sub_id, service, node): 675 def checkCacheSubscribeCb(self, sub_id, service, node):
676 self.cache_pubsub_sub.add((service, node, sub_id)) 676 self.cache_pubsub_sub.add((service, node, sub_id))