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
Carlos Ramos Carreño
erp5
Commits
69a59dbe
Commit
69a59dbe
authored
Mar 08, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix SyntaxWarning
parent
5597b78a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
17 deletions
+17
-17
product/ERP5/Document/Resource.py
product/ERP5/Document/Resource.py
+3
-3
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_validateRelation.py
...plateItem/portal_skins/erp5_core/Base_validateRelation.py
+1
-1
product/ERP5Type/Accessor/Translation.py
product/ERP5Type/Accessor/Translation.py
+1
-1
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+9
-9
product/ERP5Type/Core/ContentExistenceConstraint.py
product/ERP5Type/Core/ContentExistenceConstraint.py
+1
-1
product/ERP5Type/XMLExportImport/ppml.py
product/ERP5Type/XMLExportImport/ppml.py
+2
-2
No files found.
product/ERP5/Document/Resource.py
View file @
69a59dbe
...
...
@@ -111,7 +111,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
| morphology/2 | (colour/blue, colour/red, size/Man, size/Woman, morphology/2)
"""
result
=
[]
if
base_category_list
is
():
if
base_category_list
==
():
base_category_list
=
self
.
getVariationBaseCategoryList
(
omit_individual_variation
=
omit_individual_variation
)
elif
isinstance
(
base_category_list
,
str
):
...
...
@@ -127,7 +127,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
if
not
omit_individual_variation
:
for
variation
in
individual_variation_list
:
for
base_category
in
variation
.
getVariationBaseCategoryList
():
if
base_category_list
is
()
\
if
base_category_list
==
()
\
or
base_category
in
base_category_list
:
other_base_category_set
.
discard
(
base_category
)
# XXX now, call Renderer a lot of time.
...
...
@@ -196,7 +196,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
for
base_category
in
variation
.
getVariationBaseCategoryList
():
# backwards compatbility: if individual_bc_list is empty, allow
# all individual variation base categories.
if
(
base_category_list
is
()
if
(
base_category_list
==
()
or
base_category
in
base_category_list
)
\
and
(
not
len
(
individual_bc_list
)
or
base_category
in
individual_bc_list
):
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_validateRelation.py
View file @
69a59dbe
...
...
@@ -77,7 +77,7 @@ try:
if
checkFieldType
(
my_field
,
'MultiRelationStringField'
):
# The checkProperty sometimes does not provide an
# acceptable value - XXXX - see vetement_id in Modele View
if
old_value
is
''
or
old_value
is
None
:
if
old_value
==
''
or
old_value
is
None
:
old_value
=
[]
try
:
old_value
=
list
(
old_value
)
...
...
product/ERP5Type/Accessor/Translation.py
View file @
69a59dbe
...
...
@@ -138,7 +138,7 @@ class PropertyTranslationDomainGetter(BaseGetter):
ptype_domain
=
''
else
:
ptype_domain
=
domain
.
getDomainName
()
if
ptype_domain
is
''
and
default
is
not
None
:
if
ptype_domain
==
''
and
default
is
not
None
:
# then get the default property defined on property sheet
value
=
default
else
:
...
...
product/ERP5Type/Base.py
View file @
69a59dbe
...
...
@@ -1014,10 +1014,10 @@ class Base(
result
=
None
else
:
if
isinstance
(
value
,
(
list
,
tuple
)):
if
len
(
value
)
is
0
:
result
=
None
else
:
if
len
(
value
):
result
=
value
[
0
]
else
:
result
=
None
else
:
result
=
value
else
:
...
...
@@ -1048,10 +1048,10 @@ class Base(
result
=
None
else
:
if
isinstance
(
value
,
(
list
,
tuple
)):
if
len
(
value
)
is
0
:
result
=
None
else
:
if
len
(
value
):
result
=
value
[
0
]
else
:
result
=
None
else
:
result
=
value
else
:
...
...
@@ -1092,10 +1092,10 @@ class Base(
result
=
None
else
:
if
isinstance
(
value
,
(
list
,
tuple
)):
if
len
(
value
)
is
0
:
result
=
None
else
:
if
len
(
value
):
result
=
value
[
0
]
else
:
result
=
None
else
:
result
=
value
else
:
...
...
product/ERP5Type/Core/ContentExistenceConstraint.py
View file @
69a59dbe
...
...
@@ -76,7 +76,7 @@ class ContentExistenceConstraint(ConstraintMixin):
# Otherwise, generate an error message
mapping
=
{}
if
portal_type
is
()
:
if
not
portal_type
:
message_id
=
'message_no_subobject'
else
:
message_id
=
'message_no_subobject_portal_type'
...
...
product/ERP5Type/XMLExportImport/ppml.py
View file @
69a59dbe
...
...
@@ -898,7 +898,7 @@ def save_bytes(self, tag, data):
v
=
b''
.
join
(
data
[
2
:])
encoding
=
a
.
get
(
'encoding'
,
'repr'
)
assert
encoding
==
'base64'
if
encoding
is
not
''
:
if
encoding
!=
''
:
v
=
unconvert
(
encoding
,
v
)
if
self
.
binary
:
l
=
len
(
v
)
...
...
@@ -922,7 +922,7 @@ def save_unicode(self, tag, data):
for
x
in
data
[
2
:]:
v
=
v
+
x
encoding
=
a
.
get
(
'encoding'
,
'repr'
)
# JPS: repr is default encoding
if
encoding
is
not
''
:
if
encoding
!=
''
:
v
=
unconvert
(
encoding
,
v
)
if
binary
:
l
=
len
(
v
)
...
...
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