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
4bc18d20
Commit
4bc18d20
authored
Oct 19, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into zope4py2
parents
4bd2f58b
4df412c9
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
47 additions
and
373 deletions
+47
-373
bt5/erp5_oauth2_authorisation/WorkflowTemplateItem/portal_workflow/oauth2_session_refresh_interaction_workflow/interactions/assignment.xml
..._refresh_interaction_workflow/interactions/assignment.xml
+0
-104
bt5/erp5_oauth2_authorisation/WorkflowTemplateItem/portal_workflow/oauth2_session_refresh_interaction_workflow/interactions/session.xml
...ion_refresh_interaction_workflow/interactions/session.xml
+0
-103
bt5/erp5_oauth2_authorisation/WorkflowTemplateItem/portal_workflow/oauth2_session_refresh_interaction_workflow/scripts/onAssignmentChange.py
...efresh_interaction_workflow/scripts/onAssignmentChange.py
+0
-7
bt5/erp5_oauth2_authorisation/WorkflowTemplateItem/portal_workflow/oauth2_session_refresh_interaction_workflow/scripts/onAssignmentChange.xml
...fresh_interaction_workflow/scripts/onAssignmentChange.xml
+0
-70
bt5/erp5_oauth2_authorisation/WorkflowTemplateItem/portal_workflow/oauth2_session_refresh_interaction_workflow/scripts/refreshOAuth2Session.py
...resh_interaction_workflow/scripts/refreshOAuth2Session.py
+0
-5
bt5/erp5_oauth2_authorisation/WorkflowTemplateItem/portal_workflow/oauth2_session_refresh_interaction_workflow/scripts/refreshOAuth2Session.xml
...esh_interaction_workflow/scripts/refreshOAuth2Session.xml
+0
-70
product/CMFActivity/Activity/SQLBase.py
product/CMFActivity/Activity/SQLBase.py
+1
-2
product/ERP5Type/tests/CodingStyleTestCase.py
product/ERP5Type/tests/CodingStyleTestCase.py
+46
-12
No files found.
bt5/erp5_oauth2_authorisation/WorkflowTemplateItem/portal_workflow/oauth2_session_refresh_interaction_workflow/interactions/assignment.xml
deleted
100644 → 0
View file @
4bd2f58b
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"InteractionDefinition"
module=
"Products.ERP5.Interaction"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
actbox_category
</string>
</key>
<value>
<string>
workflow
</string>
</value>
</item>
<item>
<key>
<string>
actbox_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
actbox_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
activate_script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
after_script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
before_commit_script_name
</string>
</key>
<value>
<list>
<string>
onAssignmentChange
</string>
</list>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
guard
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
assignment
</string>
</value>
</item>
<item>
<key>
<string>
method_id
</string>
</key>
<value>
<list>
<string>
_set.*
</string>
<string>
open
</string>
<string>
update
</string>
</list>
</value>
</item>
<item>
<key>
<string>
once_per_transaction
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
portal_type_filter
</string>
</key>
<value>
<list>
<string>
Assignment
</string>
</list>
</value>
</item>
<item>
<key>
<string>
portal_type_group_filter
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
temporary_document_disallowed
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
trigger_type
</string>
</key>
<value>
<int>
2
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_oauth2_authorisation/WorkflowTemplateItem/portal_workflow/oauth2_session_refresh_interaction_workflow/interactions/session.xml
deleted
100644 → 0
View file @
4bd2f58b
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"InteractionDefinition"
module=
"Products.ERP5.Interaction"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
actbox_category
</string>
</key>
<value>
<string>
workflow
</string>
</value>
</item>
<item>
<key>
<string>
actbox_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
actbox_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
activate_script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
after_script_name
</string>
</key>
<value>
<list>
<string>
refreshOAuth2Session
</string>
</list>
</value>
</item>
<item>
<key>
<string>
before_commit_script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
React to selected properties changing on the session itself to trigger a token refresh.
</string>
</value>
</item>
<item>
<key>
<string>
guard
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
session
</string>
</value>
</item>
<item>
<key>
<string>
method_id
</string>
</key>
<value>
<list>
<string>
_setPolicyExpirationDate
</string>
<string>
_setNetwork.*
</string>
</list>
</value>
</item>
<item>
<key>
<string>
once_per_transaction
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
portal_type_filter
</string>
</key>
<value>
<list>
<string>
OAuth2 Session
</string>
</list>
</value>
</item>
<item>
<key>
<string>
portal_type_group_filter
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
temporary_document_disallowed
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
trigger_type
</string>
</key>
<value>
<int>
2
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_oauth2_authorisation/WorkflowTemplateItem/portal_workflow/oauth2_session_refresh_interaction_workflow/scripts/onAssignmentChange.py
deleted
100644 → 0
View file @
4bd2f58b
# Proxy role: Manager, because the originator for the event which triggered
# this interaction may have been using a proxy role itself, and we should
# not limit what can be done on Assignments, but just follow what is being
# done.
context
.
getPortalObject
().
ERP5Site_refreshUserRelatedOAuth2SessionSet
(
user_value_list
=
(
state_change
[
'object'
].
getParentValue
(),
),
)
bt5/erp5_oauth2_authorisation/WorkflowTemplateItem/portal_workflow/oauth2_session_refresh_interaction_workflow/scripts/onAssignmentChange.xml
deleted
100644 → 0
View file @
4bd2f58b
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
onAssignmentChange
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_oauth2_authorisation/WorkflowTemplateItem/portal_workflow/oauth2_session_refresh_interaction_workflow/scripts/refreshOAuth2Session.py
deleted
100644 → 0
View file @
4bd2f58b
# Proxy role: Manager, because the originator for the event which triggered
# this interaction may have been using a proxy role itself, and we should
# not limit what can be done on Assignments, but just follow what is being
# done.
state_change
[
'object'
].
refreshAccessToken
()
bt5/erp5_oauth2_authorisation/WorkflowTemplateItem/portal_workflow/oauth2_session_refresh_interaction_workflow/scripts/refreshOAuth2Session.xml
deleted
100644 → 0
View file @
4bd2f58b
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
refreshOAuth2Session
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/CMFActivity/Activity/SQLBase.py
View file @
4bc18d20
...
@@ -674,10 +674,9 @@ CREATE TABLE %s (
...
@@ -674,10 +674,9 @@ CREATE TABLE %s (
def
distribute
(
self
,
activity_tool
,
node_count
):
def
distribute
(
self
,
activity_tool
,
node_count
):
db
=
activity_tool
.
getSQLConnection
()
db
=
activity_tool
.
getSQLConnection
()
now_date
=
getNow
(
db
)
where_kw
=
{
where_kw
=
{
'processing_node'
:
-
1
,
'processing_node'
:
-
1
,
'to_date'
:
now_date
,
'to_date'
:
getNow
(
db
)
,
'count'
:
READ_MESSAGE_LIMIT
,
'count'
:
READ_MESSAGE_LIMIT
,
}
}
validated_count
=
0
validated_count
=
0
...
...
product/ERP5Type/tests/CodingStyleTestCase.py
View file @
4bc18d20
...
@@ -138,6 +138,10 @@ class CodingStyleTestCase(ERP5TypeTestCase):
...
@@ -138,6 +138,10 @@ class CodingStyleTestCase(ERP5TypeTestCase):
template_tool
=
self
.
portal
.
portal_templates
template_tool
=
self
.
portal
.
portal_templates
for
bt_title
in
self
.
getTestedBusinessTemplateList
():
for
bt_title
in
self
.
getTestedBusinessTemplateList
():
bt
=
template_tool
.
getInstalledBusinessTemplate
(
bt_title
,
strict
=
True
)
bt
=
template_tool
.
getInstalledBusinessTemplate
(
bt_title
,
strict
=
True
)
# run migrations on the business template, except for the BT used to
# test workflow migration.
if
bt_title
!=
'erp5_workflow_test'
:
bt
.
BusinessTemplate_convertAllDCWorkflowToERP5Workflow
()
# make sure we can rebuild
# make sure we can rebuild
bt
.
build
()
bt
.
build
()
...
@@ -155,27 +159,57 @@ class CodingStyleTestCase(ERP5TypeTestCase):
...
@@ -155,27 +159,57 @@ class CodingStyleTestCase(ERP5TypeTestCase):
if
p
and
not
p
.
strip
().
startswith
(
"#"
)}
if
p
and
not
p
.
strip
().
startswith
(
"#"
)}
diff_line_list
=
[]
diff_line_list
=
[]
def
get_difference
(
path
,
has_old
=
True
,
has_new
=
True
):
old
=
(
os
.
path
.
join
(
bt_base_path
,
path
)
if
has_old
else
os
.
devnull
)
new
=
(
os
.
path
.
join
(
export_base_path
,
path
)
if
has_new
else
os
.
devnull
)
old_is_dir
=
os
.
path
.
isdir
(
old
)
new_is_dir
=
os
.
path
.
isdir
(
new
)
# Raise if we are going from a directory to a file or vice-versa.
assert
not
has_old
or
not
has_new
or
old_is_dir
==
new_is_dir
,
(
path
,
old_is_dir
,
new_is_dir
)
if
old_is_dir
or
new_is_dir
:
return
with
open
(
old
)
as
ff
,
open
(
new
)
as
tf
:
diff_line_list
.
extend
(
difflib
.
unified_diff
(
ff
.
readlines
(),
tf
.
readlines
(),
(
os
.
path
.
join
(
'git'
,
path
)
if
has_old
else
os
.
devnull
),
(
os
.
path
.
join
(
'bt5'
,
path
)
if
has_new
else
os
.
devnull
),
),
)
def
get_differences
(
dcmp
,
base
):
def
get_differences
(
dcmp
,
base
):
for
name
in
dcmp
.
left_only
:
for
name
in
dcmp
.
left_only
:
yield
'removed: '
+
os
.
path
.
join
(
base
,
name
)
path
=
os
.
path
.
join
(
base
,
name
)
yield
'removed: '
+
path
get_difference
(
path
,
has_new
=
False
)
for
name
in
dcmp
.
right_only
:
for
name
in
dcmp
.
right_only
:
yield
'added: '
+
os
.
path
.
join
(
base
,
name
)
path
=
os
.
path
.
join
(
base
,
name
)
yield
'added: '
+
path
get_difference
(
path
,
has_old
=
False
)
for
name
in
dcmp
.
funny_files
:
for
name
in
dcmp
.
funny_files
:
yield
'funny: '
+
os
.
path
.
join
(
base
,
name
)
yield
'funny: '
+
os
.
path
.
join
(
base
,
name
)
for
name
in
dcmp
.
diff_files
:
for
name
in
dcmp
.
diff_files
:
path
=
os
.
path
.
join
(
base
,
name
)
path
=
os
.
path
.
join
(
base
,
name
)
get_difference
(
path
)
if
not
any
(
fnmatch
.
fnmatch
(
path
,
ignored_path
)
for
ignored_path
in
ignored_paths
):
if
not
any
(
fnmatch
.
fnmatch
(
path
,
ignored_path
)
for
ignored_path
in
ignored_paths
):
yield
'modified: '
+
path
yield
'modified: '
+
path
with
open
(
os
.
path
.
join
(
bt_base_path
,
path
))
as
ff
,
\
open
(
os
.
path
.
join
(
export_base_path
,
path
))
as
tf
:
diff_line_list
.
extend
(
difflib
.
unified_diff
(
ff
.
readlines
(),
tf
.
readlines
(),
os
.
path
.
join
(
'git'
,
path
),
os
.
path
.
join
(
'bt5'
,
path
),
))
diff_line_list
.
append
(
'
\
n
'
)
for
sub_path
,
sub_dcmp
in
six
.
iteritems
(
dcmp
.
subdirs
):
for
sub_path
,
sub_dcmp
in
six
.
iteritems
(
dcmp
.
subdirs
):
for
diff
in
get_differences
(
sub_dcmp
,
os
.
path
.
join
(
base
,
sub_path
)):
for
diff
in
get_differences
(
sub_dcmp
,
os
.
path
.
join
(
base
,
sub_path
)):
yield
diff
yield
diff
...
...
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