Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
erp5
Commits
2c0fb219
Commit
2c0fb219
authored
Feb 07, 2020
by
Romain Courteaud
Committed by
Xiaowu Zhang
Apr 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: fixup modification date retrieval
See
nexedi/erp5@2e3f7a8a
parent
cfca17fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/WebPage_viewAsWeb.py
...em/portal_skins/erp5_web_renderjs_ui/WebPage_viewAsWeb.py
+12
-9
No files found.
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/WebPage_viewAsWeb.py
View file @
2c0fb219
from
DateTime
import
DateTime
import
json
if
REQUEST
is
None
:
if
REQUEST
is
None
:
REQUEST
=
context
.
REQUEST
REQUEST
=
context
.
REQUEST
if
response
is
None
:
if
response
is
None
:
...
@@ -10,15 +13,15 @@ response.setBase(None)
...
@@ -10,15 +13,15 @@ response.setBase(None)
response
.
setHeader
(
"Access-Control-Allow-Origin"
,
"*"
)
response
.
setHeader
(
"Access-Control-Allow-Origin"
,
"*"
)
web_page
=
context
web_page
=
context
web_section
=
REQUEST
.
get
(
"current_web_section"
)
web_section
=
context
.
getWebSectionValue
(
)
if
web_section
is
None
:
# Must-Revalidate caching policy uses Base_getWebSiteDrivenModificationDate
parent_value
=
context
.
getParentValue
()
modification_date_string
=
web_page
.
Base_getWebSiteDrivenModificationDate
().
rfc822
()
if
parent_value
.
getPortalType
()
==
"Web Section"
:
web_section
=
parent_value
modified_since
=
REQUEST
.
getHeader
(
'If-Modified-Since'
,
''
)
if
modified_since
:
if
REQUEST
.
getHeader
(
'If-Modified-Since'
,
''
)
==
web_page
.
getModificationDate
().
rfc822
()
:
if
DateTime
(
modified_since
).
rfc822
()
==
modification_date_string
:
response
.
setStatus
(
304
)
response
.
setStatus
(
304
)
return
""
return
""
portal_type
=
web_page
.
getPortalType
()
portal_type
=
web_page
.
getPortalType
()
web_content
=
web_page
.
getTextContent
()
web_content
=
web_page
.
getTextContent
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment