Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
a1b0868d
Commit
a1b0868d
authored
May 15, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support date based on property.
parent
0594e893
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
master/product/Vifib/Tool/VifibRestApiV1Tool.py
master/product/Vifib/Tool/VifibRestApiV1Tool.py
+9
-5
No files found.
master/product/Vifib/Tool/VifibRestApiV1Tool.py
View file @
a1b0868d
...
...
@@ -73,7 +73,7 @@ def requireHeader(header_dict):
return
wrapperRequireHeader
return
outer
def
supportModifiedSince
(
document_url_id
=
None
):
def
supportModifiedSince
(
document_url_id
=
None
,
modified_property_id
=
None
):
def
outer
(
fn
):
def
wrapperSupportModifiedSince
(
self
,
*
args
,
**
kwargs
):
modified_since
=
self
.
REQUEST
.
getHeader
(
'If-Modified-Since'
)
...
...
@@ -89,12 +89,16 @@ def supportModifiedSince(document_url_id=None):
# client send date before current time, shall continue and
# compare with second precision, as client by default shall set
# If-Modified-Since to last known Last-Modified value
if
document_url_id
is
None
:
document
=
None
if
document_url_id
is
None
and
modified_property_id
is
None
:
document
=
self
el
s
e
:
el
if
document_url_id
is
not
Non
e
:
document
=
self
.
restrictedTraverse
(
getattr
(
self
,
document_url_id
))
document_date
=
document
.
getModificationDate
()
or
\
self
.
bobobase_modification_time
()
else
:
document_date
=
getattr
(
self
,
modified_property_id
)
if
document
is
not
None
:
document_date
=
document
.
getModificationDate
()
or
\
self
.
bobobase_modification_time
()
if
int
(
document_date
.
timeTime
())
<=
int
(
modified_since
.
timeTime
()):
# document was not modified since
self
.
REQUEST
.
response
.
setStatus
(
304
)
...
...
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