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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Mukul
erp5
Commits
9b17886d
Commit
9b17886d
authored
Jan 10, 2018
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_corporate_identity: handle missing images explicitly
parent
a51feaa0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_validateImage.py
...al_skins/erp5_corporate_identity/WebPage_validateImage.py
+4
-2
No files found.
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_validateImage.py
View file @
9b17886d
...
...
@@ -12,6 +12,7 @@ Upgrade image for the specific type of display
# img_svg_format display image as svg (default png/None)
import
re
from
OFS.Traversable
import
NotFound
if
img_string
==
None
or
img_string
==
""
:
return
img_string
...
...
@@ -20,8 +21,9 @@ img_src = re.findall("src=['\"](.*?)['\"]", img_string)[0]
img_obj
=
context
.
restrictedTraverse
(
img_src
.
split
(
"?"
)[
0
])
img_type
=
img_obj
.
getContentType
()
# XXX flag broken link
# if img_obj is None:
# flag broken link until further notice
if
img_obj
is
None
:
raise
NotFound
(
'The following image could not be found in erp5: %s'
%
(
img_src
.
split
(
"?"
)[
0
]))
# ensure alt attributes are set
if
img_string
.
find
(
'alt='
)
==
-
1
:
...
...
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