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
Ludovic Kiefer
erp5
Commits
a7b5c18e
Commit
a7b5c18e
authored
Mar 11, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
credential: fix pylint messages and enable coding style test
parent
37039ff5
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
301 additions
and
182 deletions
+301
-182
bt5/erp5_credential/DocumentTemplateItem/portal_components/document.erp5.CredentialRecovery.py
...tem/portal_components/document.erp5.CredentialRecovery.py
+31
-36
bt5/erp5_credential/DocumentTemplateItem/portal_components/document.erp5.CredentialRecovery.xml
...em/portal_components/document.erp5.CredentialRecovery.xml
+62
-19
bt5/erp5_credential/DocumentTemplateItem/portal_components/document.erp5.CredentialRequest.py
...Item/portal_components/document.erp5.CredentialRequest.py
+47
-46
bt5/erp5_credential/DocumentTemplateItem/portal_components/document.erp5.CredentialRequest.xml
...tem/portal_components/document.erp5.CredentialRequest.xml
+62
-19
bt5/erp5_credential/ExtensionTemplateItem/portal_components/extension.erp5.Credential.py
...mplateItem/portal_components/extension.erp5.Credential.py
+2
-2
bt5/erp5_credential/ExtensionTemplateItem/portal_components/extension.erp5.Credential.xml
...plateItem/portal_components/extension.erp5.Credential.xml
+62
-19
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Address_getIdTranslationDict.py
...tal_skins/erp5_credential/Address_getIdTranslationDict.py
+1
-1
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRecovery_sendPasswordResetLink.py
...p5_credential/CredentialRecovery_sendPasswordResetLink.py
+0
-1
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_checkLoginAvailability.py
...p5_credential/CredentialRequest_checkLoginAvailability.py
+2
-2
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_closePersonAssignment.xml
...p5_credential/CredentialRequest_closePersonAssignment.xml
+1
-1
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.py
...credential/CredentialRequest_createPersonAndAssignment.py
+0
-2
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml
...redential/CredentialRequest_createPersonAndAssignment.xml
+1
-1
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setDefaultDestinationDecision.xml
...ntial/CredentialRequest_setDefaultDestinationDecision.xml
+1
-1
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToOrganisation.py
...edentialRequest_setRegisteredInformationToOrganisation.py
+2
-1
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToPerson.py
...ial/CredentialRequest_setRegisteredInformationToPerson.py
+0
-1
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_updatePersonAssignment.py
...p5_credential/CredentialRequest_updatePersonAssignment.py
+0
-1
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_copyDefaultImage.py
...kins/erp5_credential/CredentialUpdate_copyDefaultImage.py
+10
-10
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_checkConsistency.xml
...tal_skins/erp5_credential/Credential_checkConsistency.xml
+1
-1
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_copyRegistredInformation.py
...ns/erp5_credential/Credential_copyRegistredInformation.py
+14
-14
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_viewCredentialRequestForm/your_reference.xml
...ial/ERP5Site_viewCredentialRequestForm/your_reference.xml
+1
-1
bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_validation_workflow/scripts/checkConsistency.py
...redential_validation_workflow/scripts/checkConsistency.py
+1
-2
bt5/erp5_credential/bt/skip_coding_style_test
bt5/erp5_credential/bt/skip_coding_style_test
+0
-1
No files found.
bt5/erp5_credential/DocumentTemplateItem/portal_components/document.erp5.CredentialRecovery.py
View file @
a7b5c18e
...
@@ -30,46 +30,41 @@ from AccessControl import ClassSecurityInfo
...
@@ -30,46 +30,41 @@ from AccessControl import ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5.Document.Ticket
import
Ticket
from
Products.ERP5.Document.Ticket
import
Ticket
from
erp5.component.mixin.EncryptedPasswordMixin
import
EncryptedPasswordMixin
from
erp5.component.mixin.EncryptedPasswordMixin
import
EncryptedPasswordMixin
try
:
from
Products
import
PluggableAuthService
from
Products.ERP5Security.ERP5UserManager
import
ERP5UserManager
except
ImportError
:
PluggableAuthService
=
None
class
CredentialRecovery
(
Ticket
,
EncryptedPasswordMixin
):
class
CredentialRecovery
(
Ticket
,
EncryptedPasswordMixin
):
"""
"""
"""
"""
meta_type
=
'ERP5 Credential Recovery'
meta_type
=
'ERP5 Credential Recovery'
portal_type
=
'Credential Recovery'
portal_type
=
'Credential Recovery'
add_permission
=
Permissions
.
AddPortalContent
add_permission
=
Permissions
.
AddPortalContent
# Declarative security
# Declarative security
security
=
ClassSecurityInfo
()
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
# Declarative properties
# Declarative properties
property_sheets
=
(
PropertySheet
.
CredentialQuestion
property_sheets
=
(
PropertySheet
.
CredentialQuestion
,
PropertySheet
.
DefaultCredentialQuestion
,
PropertySheet
.
DefaultCredentialQuestion
,
PropertySheet
.
Login
,
PropertySheet
.
Login
,
PropertySheet
.
Codification
,
PropertySheet
.
Codification
,
PropertySheet
.
Person
,
PropertySheet
.
Person
,
PropertySheet
.
Url
,
PropertySheet
.
Url
)
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isAnswerCorrect'
)
'isAnswerCorrect'
)
def
isAnswerCorrect
(
self
):
def
isAnswerCorrect
(
self
):
'''
'''
Check if the given answer match the real answer
Check if the given answer match the real answer
The answer is not case sensitive
The answer is not case sensitive
'''
'''
related_person
=
self
.
getDestinationDecisionValue
()
related_person
=
self
.
getDestinationDecisionValue
()
if
related_person
is
not
None
:
if
related_person
is
not
None
:
real_answer
=
related_person
.
getDefaultCredentialQuestionAnswer
()
real_answer
=
related_person
.
getDefaultCredentialQuestionAnswer
()
if
real_answer
is
not
None
:
if
real_answer
is
not
None
:
proposed_answer
=
self
.
getDefaultCredentialQuestionAnswer
()
proposed_answer
=
self
.
getDefaultCredentialQuestionAnswer
()
if
proposed_answer
is
not
None
:
if
proposed_answer
is
not
None
:
return
real_answer
.
lower
()
==
proposed_answer
.
lower
()
return
real_answer
.
lower
()
==
proposed_answer
.
lower
()
return
False
return
False
bt5/erp5_credential/DocumentTemplateItem/portal_components/document.erp5.CredentialRecovery.xml
View file @
a7b5c18e
...
@@ -6,10 +6,22 @@
...
@@ -6,10 +6,22 @@
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<item>
<key>
<string>
default_reference
</string>
</key>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
CredentialRecovery
</string>
</value>
<value>
<string>
CredentialRecovery
</string>
</value>
</item>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
document.erp5.CredentialRecovery
</string>
</value>
<value>
<string>
document.erp5.CredentialRecovery
</string>
</value>
...
@@ -24,6 +36,18 @@
...
@@ -24,6 +36,18 @@
<none/>
<none/>
</value>
</value>
</item>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<item>
<key>
<string>
version
</string>
</key>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
<value>
<string>
erp5
</string>
</value>
...
@@ -31,13 +55,28 @@
...
@@ -31,13 +55,28 @@
<item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<key>
<string>
workflow_history
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
</pickle>
...
@@ -50,7 +89,7 @@
...
@@ -50,7 +89,7 @@
<item>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
@@ -59,26 +98,30 @@
...
@@ -59,26 +98,30 @@
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<tuple>
<dictionary>
<none/>
<item>
<list>
<key>
<string>
_log
</string>
</key>
<dictionary>
<value>
<item>
<list>
<key>
<string>
action
</string>
</key>
<dictionary>
<value>
<string>
validate
</string>
</value>
<item>
</item>
<key>
<string>
action
</string>
</key>
<item>
<value>
<string>
validate
</string>
</value>
<key>
<string>
validation_state
</string>
</key>
</item>
<value>
<string>
validated
</string>
</value>
<item>
</item>
<key>
<string>
validation_state
</string>
</key>
</dictionary>
<value>
<string>
validated
</string>
</value>
</list>
</item>
</tuple>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</pickle>
</record>
</record>
</ZopeData>
</ZopeData>
bt5/erp5_credential/DocumentTemplateItem/portal_components/document.erp5.CredentialRequest.py
View file @
a7b5c18e
...
@@ -31,58 +31,59 @@ from Products.ERP5Type import Permissions, PropertySheet
...
@@ -31,58 +31,59 @@ from Products.ERP5Type import Permissions, PropertySheet
from
Products.ERP5.Document.Ticket
import
Ticket
from
Products.ERP5.Document.Ticket
import
Ticket
from
erp5.component.mixin.EncryptedPasswordMixin
import
EncryptedPasswordMixin
from
erp5.component.mixin.EncryptedPasswordMixin
import
EncryptedPasswordMixin
class
CredentialRequest
(
Ticket
,
EncryptedPasswordMixin
):
class
CredentialRequest
(
Ticket
,
EncryptedPasswordMixin
):
"""
"""
"""
"""
meta_type
=
'ERP5 Credential Request'
meta_type
=
'ERP5 Credential Request'
portal_type
=
'Credential Request'
portal_type
=
'Credential Request'
add_permission
=
Permissions
.
AddPortalContent
add_permission
=
Permissions
.
AddPortalContent
# Declarative security
# Declarative security
security
=
ClassSecurityInfo
()
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
# Declarative properties
# Declarative properties
property_sheets
=
(
PropertySheet
.
CredentialQuestion
property_sheets
=
(
PropertySheet
.
CredentialQuestion
,
PropertySheet
.
DefaultCredentialQuestion
,
PropertySheet
.
DefaultCredentialQuestion
,
PropertySheet
.
Login
,
PropertySheet
.
Login
,
PropertySheet
.
Codification
,
PropertySheet
.
Codification
,
PropertySheet
.
Person
,
PropertySheet
.
Person
,
PropertySheet
.
Reference
,
PropertySheet
.
Reference
,
PropertySheet
.
Url
,
PropertySheet
.
Url
)
)
def
checkUserCanChangePassword
(
self
):
def
checkUserCanChangePassword
(
self
):
# every body can change a password of a credential request as annonymous
# every body can change a password of a credential request as annonymous
# should be able to do it
# should be able to do it
pass
pass
def
checkPasswordValueAcceptable
(
self
,
value
):
def
checkPasswordValueAcceptable
(
self
,
value
):
# all passwords are acceptable on Credential Request
# all passwords are acceptable on Credential Request
pass
pass
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getTitle'
)
'getTitle'
)
def
getTitle
(
self
,
**
kw
):
def
getTitle
(
self
,
**
kw
):
"""
"""
Returns the title if it exists or a combination of
Returns the title if it exists or a combination of
first name and last name
first name and last name
"""
"""
if
self
.
title
==
''
:
if
self
.
title
==
''
:
name_list
=
[]
name_list
=
[]
if
self
.
getFirstName
()
not
in
(
None
,
''
):
if
self
.
getFirstName
()
not
in
(
None
,
''
):
name_list
.
append
(
self
.
getFirstName
())
name_list
.
append
(
self
.
getFirstName
())
if
self
.
getLastName
()
not
in
(
None
,
''
):
if
self
.
getLastName
()
not
in
(
None
,
''
):
name_list
.
append
(
self
.
getLastName
())
name_list
.
append
(
self
.
getLastName
())
if
name_list
:
if
name_list
:
return
' '
.
join
(
name_list
)
return
' '
.
join
(
name_list
)
return
self
.
getReference
()
or
self
.
getId
()
return
self
.
getReference
()
or
self
.
getId
()
else
:
else
:
return
self
.
title
return
self
.
title
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'hasTitle'
)
'hasTitle'
)
def
hasTitle
(
self
):
def
hasTitle
(
self
):
return
self
.
title
or
self
.
hasFirstName
()
or
self
.
hasLastName
()
return
self
.
title
or
self
.
hasFirstName
()
or
self
.
hasLastName
()
bt5/erp5_credential/DocumentTemplateItem/portal_components/document.erp5.CredentialRequest.xml
View file @
a7b5c18e
...
@@ -6,10 +6,22 @@
...
@@ -6,10 +6,22 @@
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<item>
<key>
<string>
default_reference
</string>
</key>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
CredentialRequest
</string>
</value>
<value>
<string>
CredentialRequest
</string>
</value>
</item>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
document.erp5.CredentialRequest
</string>
</value>
<value>
<string>
document.erp5.CredentialRequest
</string>
</value>
...
@@ -24,6 +36,18 @@
...
@@ -24,6 +36,18 @@
<none/>
<none/>
</value>
</value>
</item>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<item>
<key>
<string>
version
</string>
</key>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
<value>
<string>
erp5
</string>
</value>
...
@@ -31,13 +55,28 @@
...
@@ -31,13 +55,28 @@
<item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<key>
<string>
workflow_history
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
</pickle>
...
@@ -50,7 +89,7 @@
...
@@ -50,7 +89,7 @@
<item>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
@@ -59,26 +98,30 @@
...
@@ -59,26 +98,30 @@
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<tuple>
<dictionary>
<none/>
<item>
<list>
<key>
<string>
_log
</string>
</key>
<dictionary>
<value>
<item>
<list>
<key>
<string>
action
</string>
</key>
<dictionary>
<value>
<string>
validate
</string>
</value>
<item>
</item>
<key>
<string>
action
</string>
</key>
<item>
<value>
<string>
validate
</string>
</value>
<key>
<string>
validation_state
</string>
</key>
</item>
<value>
<string>
validated
</string>
</value>
<item>
</item>
<key>
<string>
validation_state
</string>
</key>
</dictionary>
<value>
<string>
validated
</string>
</value>
</list>
</item>
</tuple>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</pickle>
</record>
</record>
</ZopeData>
</ZopeData>
bt5/erp5_credential/ExtensionTemplateItem/portal_components/extension.erp5.Credential.py
View file @
a7b5c18e
...
@@ -71,9 +71,9 @@ def isSingleSignOnEnable(self):
...
@@ -71,9 +71,9 @@ def isSingleSignOnEnable(self):
if
isinstance
(
acl_users
,
PluggableAuthServiceTool
):
if
isinstance
(
acl_users
,
PluggableAuthServiceTool
):
#List plugin which make authentication
#List plugin which make authentication
plugin_list
=
acl_users
.
plugins
.
listPlugins
(
IAuthenticationPlugin
)
plugin_list
=
acl_users
.
plugins
.
listPlugins
(
IAuthenticationPlugin
)
for
plugin_name
,
plugin_value
in
plugin_list
:
for
_
,
plugin_value
in
plugin_list
:
#Try to find an ERP5RemoteUserManager
#Try to find an ERP5RemoteUserManager
if
isinstance
(
plugin_value
,
ERP5RemoteUserManager
):
if
isinstance
(
plugin_value
,
ERP5RemoteUserManager
):
#SSO is enable
#SSO is enable
return
True
return
True
return
False
return
False
bt5/erp5_credential/ExtensionTemplateItem/portal_components/extension.erp5.Credential.xml
View file @
a7b5c18e
...
@@ -6,10 +6,22 @@
...
@@ -6,10 +6,22 @@
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<item>
<key>
<string>
default_reference
</string>
</key>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
Credential
</string>
</value>
<value>
<string>
Credential
</string>
</value>
</item>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
extension.erp5.Credential
</string>
</value>
<value>
<string>
extension.erp5.Credential
</string>
</value>
...
@@ -24,6 +36,18 @@
...
@@ -24,6 +36,18 @@
<none/>
<none/>
</value>
</value>
</item>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<item>
<key>
<string>
version
</string>
</key>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
<value>
<string>
erp5
</string>
</value>
...
@@ -31,13 +55,28 @@
...
@@ -31,13 +55,28 @@
<item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<key>
<string>
workflow_history
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
</pickle>
...
@@ -50,7 +89,7 @@
...
@@ -50,7 +89,7 @@
<item>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
@@ -59,26 +98,30 @@
...
@@ -59,26 +98,30 @@
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<tuple>
<dictionary>
<none/>
<item>
<list>
<key>
<string>
_log
</string>
</key>
<dictionary>
<value>
<item>
<list>
<key>
<string>
action
</string>
</key>
<dictionary>
<value>
<string>
validate
</string>
</value>
<item>
</item>
<key>
<string>
action
</string>
</key>
<item>
<value>
<string>
validate
</string>
</value>
<key>
<string>
validation_state
</string>
</key>
</item>
<value>
<string>
validated
</string>
</value>
<item>
</item>
<key>
<string>
validation_state
</string>
</key>
</dictionary>
<value>
<string>
validated
</string>
</value>
</list>
</item>
</tuple>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</pickle>
</record>
</record>
</ZopeData>
</ZopeData>
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Address_getIdTranslationDict.py
View file @
a7b5c18e
if
context
.
getParentValue
().
portal_type
==
'Credential Request'
:
if
context
.
getParentValue
().
portal_type
==
'Credential Request'
:
return
{
'Address'
:
dict
(
organisation_default_address
=
'Organisation Default Address'
)}
return
{
'Address'
:
dict
(
organisation_default_address
=
'Organisation Default Address'
)}
return
{}
return
{}
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRecovery_sendPasswordResetLink.py
View file @
a7b5c18e
...
@@ -3,7 +3,6 @@ send the password reset link by mail
...
@@ -3,7 +3,6 @@ send the password reset link by mail
"""
"""
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
person
=
context
.
getDestinationDecisionValue
(
portal_type
=
"Person"
)
reference
=
context
.
getReference
()
reference
=
context
.
getReference
()
if
context
.
hasDocumentReference
():
if
context
.
hasDocumentReference
():
message_reference
=
context
.
getDocumentReference
()
message_reference
=
context
.
getDocumentReference
()
...
...
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_checkLoginAvailability.py
View file @
a7b5c18e
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
Parameters:
Parameters:
value -- field value (string)
value -- field value (string)
REQUEST -- standard REQUEST variable"""
REQUEST -- standard REQUEST variable"""
portal
=
context
.
getPortalObject
()
if
value
:
if
value
:
# Same tag is used as in ERP5 Login _setReference, in order to protect against
# Same tag is used as in ERP5 Login _setReference, in order to protect against
...
@@ -13,7 +14,6 @@ def getRealContext():
...
@@ -13,7 +14,6 @@ def getRealContext():
if
not
REQUEST
:
if
not
REQUEST
:
return
context
return
context
object_path
=
REQUEST
.
get
(
"object_path"
)
object_path
=
REQUEST
.
get
(
"object_path"
)
portal
=
context
.
getPortalObject
()
return
portal
.
restrictedTraverse
(
object_path
)
return
portal
.
restrictedTraverse
(
object_path
)
#Allow user to create a request with it's username
#Allow user to create a request with it's username
...
@@ -29,7 +29,7 @@ if context.getPortalType() == "Credential Request":
...
@@ -29,7 +29,7 @@ if context.getPortalType() == "Credential Request":
related_person
=
context
.
getDestinationDecisionValue
(
portal_type
=
"Person"
)
related_person
=
context
.
getDestinationDecisionValue
(
portal_type
=
"Person"
)
if
related_person
is
not
None
:
if
related_person
is
not
None
:
for
erp5_login_value
in
related_person
.
objectValues
(
for
erp5_login_value
in
related_person
.
objectValues
(
portal_type
=
self
.
getPortalObject
()
.
getPortalLoginTypeList
(),
portal_type
=
portal
.
getPortalLoginTypeList
(),
):
):
if
erp5_login_value
.
getValidationState
()
==
'validated'
and
erp5_login_value
.
getReference
()
==
value
:
if
erp5_login_value
.
getValidationState
()
==
'validated'
and
erp5_login_value
.
getReference
()
==
value
:
return
True
return
True
...
...
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_closePersonAssignment.xml
View file @
a7b5c18e
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
role=
[],
comment=""
</string>
</value>
<value>
<string>
role=
(),
comment=""
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.py
View file @
a7b5c18e
...
@@ -9,8 +9,6 @@
...
@@ -9,8 +9,6 @@
if
REQUEST
is
not
None
:
if
REQUEST
is
not
None
:
return
None
return
None
portal
=
context
.
getPortalObject
()
portal_preferences
=
context
.
portal_preferences
# XXX by default we don't want to automatically create/update organisation
# XXX by default we don't want to automatically create/update organisation
# Someone should confirm this informations before creating the organisation
# Someone should confirm this informations before creating the organisation
...
...
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml
View file @
a7b5c18e
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
related_portal_type
= [\'Person\']
, REQUEST=None
</string>
</value>
<value>
<string>
related_portal_type
=(\'Person\', )
, REQUEST=None
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setDefaultDestinationDecision.xml
View file @
a7b5c18e
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
create_portal_type=
["Person"]
, REQUEST=None
</string>
</value>
<value>
<string>
create_portal_type=
("Person",)
, REQUEST=None
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToOrganisation.py
View file @
a7b5c18e
from
Products.ERP5Type.Errors
import
UnsupportedWorkflowMethod
"""Copy subscription information to the related organisation"""
"""Copy subscription information to the related organisation"""
context
.
Credential_checkConsistency
([
'Organisation'
])
context
.
Credential_checkConsistency
([
'Organisation'
])
...
@@ -19,5 +20,5 @@ context.Credential_copyRegistredInformation(organisation, organisation_mapping)
...
@@ -19,5 +20,5 @@ context.Credential_copyRegistredInformation(organisation, organisation_mapping)
#Try to validate
#Try to validate
try
:
try
:
organisation
.
validate
()
organisation
.
validate
()
except
:
except
UnsupportedWorkflowMethod
:
pass
pass
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToPerson.py
View file @
a7b5c18e
...
@@ -7,7 +7,6 @@ if REQUEST is not None:
...
@@ -7,7 +7,6 @@ if REQUEST is not None:
return
None
return
None
from
Products.ERP5Type.Errors
import
UnsupportedWorkflowMethod
from
Products.ERP5Type.Errors
import
UnsupportedWorkflowMethod
from
Products.ERP5Type.Utils
import
sleep
context
.
Credential_checkConsistency
([
'Person'
])
context
.
Credential_checkConsistency
([
'Person'
])
person
=
context
.
getDestinationDecisionValue
(
portal_type
=
"Person"
)
person
=
context
.
getDestinationDecisionValue
(
portal_type
=
"Person"
)
...
...
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_updatePersonAssignment.py
View file @
a7b5c18e
...
@@ -8,7 +8,6 @@ if REQUEST is not None:
...
@@ -8,7 +8,6 @@ if REQUEST is not None:
person
=
context
.
getDestinationDecisionValue
(
portal_type
=
"Person"
)
person
=
context
.
getDestinationDecisionValue
(
portal_type
=
"Person"
)
organisation
=
context
.
getDestinationDecisionValue
(
portal_type
=
"Organisation"
)
organisation
=
context
.
getDestinationDecisionValue
(
portal_type
=
"Organisation"
)
assignment_configuration
=
{}
#Look on current assignment
#Look on current assignment
old_role_list
=
context
.
portal_categories
.
role
.
getCategoryChildLogicalPathItemList
()[
1
:]
old_role_list
=
context
.
portal_categories
.
role
.
getCategoryChildLogicalPathItemList
()[
1
:]
#old_role_list look like [['title','logical_path'],]
#old_role_list look like [['title','logical_path'],]
...
...
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_copyDefaultImage.py
View file @
a7b5c18e
...
@@ -5,21 +5,21 @@ Manager -- allow to update all image property"""
...
@@ -5,21 +5,21 @@ Manager -- allow to update all image property"""
if
REQUEST
is
not
None
:
if
REQUEST
is
not
None
:
raise
ValueError
,
"This script can not be call from url"
raise
ValueError
,
"This script can not be call from url"
def
getAccessor
(
prop
erty
):
def
getAccessor
(
prop
):
return
""
.
join
([
x
.
capitalize
()
for
x
in
prop
erty
.
split
(
'_'
)])
return
""
.
join
([
x
.
capitalize
()
for
x
in
prop
.
split
(
'_'
)])
def
copyValue
(
source_document
,
source_accessor
,
def
copyValue
(
source_document
,
source_accessor
,
destination_document
,
destination_accessor
):
destination_document
,
destination_accessor
):
getter
=
getattr
(
source_document
,
'get%s'
%
source_accessor
)
getter
=
getattr
(
source_document
,
'get%s'
%
source_accessor
)
value
=
getter
()
value
=
getter
()
setter
=
getattr
(
destination_document
,
'set%s'
%
destination_accessor
)
setter
=
getattr
(
destination_document
,
'set%s'
%
destination_accessor
)
setter
(
value
)
setter
(
value
)
def
copyDocument
(
source_document
,
destination_document
,
mapping
):
def
copyDocument
(
source_document
,
destination_document
,
mapping
):
for
source_property
,
destination_property
in
mapping
:
for
source_property
,
destination_property
in
mapping
:
source_accessor
,
destination_accessor
=
getAccessor
(
source_property
),
getAccessor
(
destination_property
)
source_accessor
,
destination_accessor
=
getAccessor
(
source_property
),
getAccessor
(
destination_property
)
copyValue
(
source_document
,
source_accessor
,
copyValue
(
source_document
,
source_accessor
,
destination_document
,
destination_accessor
)
destination_document
,
destination_accessor
)
new_default_image
=
context
.
getDefaultImageValue
()
new_default_image
=
context
.
getDefaultImageValue
()
if
new_default_image
is
not
None
:
if
new_default_image
is
not
None
:
...
...
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_checkConsistency.xml
View file @
a7b5c18e
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
destination_decision_type=
[\'Person\']
</string>
</value>
<value>
<string>
destination_decision_type=
(\'Person\', )
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<key>
<string>
_proxy_roles
</string>
</key>
...
...
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_copyRegistredInformation.py
View file @
a7b5c18e
...
@@ -4,25 +4,25 @@ destination -- Object where copy property value
...
@@ -4,25 +4,25 @@ destination -- Object where copy property value
mapping -- Define property mapping (List of tuple of 2 property)
mapping -- Define property mapping (List of tuple of 2 property)
copy_none_value -- Copy or not None value of context to destination
copy_none_value -- Copy or not None value of context to destination
erase_empty_value -- Erase or not empty value of destination"""
erase_empty_value -- Erase or not empty value of destination"""
def
getAccessor
(
prop
erty
):
def
getAccessor
(
prop
):
return
""
.
join
([
x
.
capitalize
()
for
x
in
prop
erty
.
split
(
'_'
)])
return
""
.
join
([
x
.
capitalize
()
for
x
in
prop
.
split
(
'_'
)])
def
copyValue
(
source_document
,
source_accessor
,
def
copyValue
(
source_document
,
source_accessor
,
destination_document
,
destination_accessor
):
destination_document
,
destination_accessor
):
getter
=
getattr
(
source_document
,
'get%s'
%
source_accessor
)
getter
=
getattr
(
source_document
,
'get%s'
%
source_accessor
)
value
=
getter
()
value
=
getter
()
if
value
is
None
and
copy_none_value
or
value
is
not
None
:
if
value
is
None
and
copy_none_value
or
value
is
not
None
:
old_getter
=
getattr
(
destination_document
,
'get%s'
%
destination_accessor
)
old_getter
=
getattr
(
destination_document
,
'get%s'
%
destination_accessor
)
old_value
=
old_getter
()
old_value
=
old_getter
()
if
not
old_value
and
erase_empty_value
or
old_value
:
if
not
old_value
and
erase_empty_value
or
old_value
:
setter
=
getattr
(
destination_document
,
'set%s'
%
destination_accessor
)
setter
=
getattr
(
destination_document
,
'set%s'
%
destination_accessor
)
setter
(
value
)
setter
(
value
)
def
copyDocument
(
source_document
,
destination_document
,
mapping
):
def
copyDocument
(
source_document
,
destination_document
,
mapping
):
for
source_property
,
destination_property
in
mapping
:
for
source_property
,
destination_property
in
mapping
:
source_accessor
,
destination_accessor
=
getAccessor
(
source_property
),
getAccessor
(
destination_property
)
source_accessor
,
destination_accessor
=
getAccessor
(
source_property
),
getAccessor
(
destination_property
)
copyValue
(
source_document
,
source_accessor
,
copyValue
(
source_document
,
source_accessor
,
destination_document
,
destination_accessor
)
destination_document
,
destination_accessor
)
...
...
bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_viewCredentialRequestForm/your_reference.xml
View file @
a7b5c18e
...
@@ -87,7 +87,7 @@
...
@@ -87,7 +87,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
form_id
</string>
</key>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
required
</string>
</key>
<key>
<string>
required
</string>
</key>
...
...
bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_validation_workflow/scripts/checkConsistency.py
View file @
a7b5c18e
object
=
state_change
[
'object'
]
state_change
[
'object'
].
Base_checkConsistency
()
object
.
Base_checkConsistency
()
bt5/erp5_credential/bt/skip_coding_style_test
deleted
100644 → 0
View file @
37039ff5
1
\ No newline at end of file
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