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
Klaus Wölfel
erp5
Commits
52296901
Commit
52296901
authored
Nov 19, 2024
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WOELFEL TEMP: catch NotFound when uploading a PDF
We should check if this should go to generic erp5
parent
928b2449
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/Document_getPropertyDictFromContent.py
...ins/erp5_ingestion/Document_getPropertyDictFromContent.py
+5
-1
No files found.
bt5/erp5_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion/Document_getPropertyDictFromContent.py
View file @
52296901
...
...
@@ -7,6 +7,7 @@ To use, write your own method (probably External Method, since it is most likely
to use re) that would analyze text content of the doc
and return a dictionary of properties.
"""
from
zExceptions
import
NotFound
information
=
context
.
getContentInformation
()
result
=
{}
...
...
@@ -21,7 +22,10 @@ for k, v in information.items():
else
:
result
[
key
]
=
v
elif
key
==
'author'
:
p
=
context
.
portal_catalog
.
getResultValue
(
title
=
v
)
try
:
p
=
context
.
portal_catalog
.
getResultValue
(
title
=
v
)
except
NotFound
:
p
=
None
if
p
is
not
None
:
result
[
'contributor'
]
=
p
.
getRelativeUrl
()
elif
key
==
'keywords'
:
...
...
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