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
422983dc
Commit
422983dc
authored
Nov 07, 2014
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DummyGateway: Fix code to access method correctly
parent
86af2076
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
product/ERP5ShortMessage/Document/DummyGateway.py
product/ERP5ShortMessage/Document/DummyGateway.py
+4
-5
No files found.
product/ERP5ShortMessage/Document/DummyGateway.py
View file @
422983dc
...
@@ -105,12 +105,11 @@ class DummyGateway(XMLObject):
...
@@ -105,12 +105,11 @@ class DummyGateway(XMLObject):
LOG
(
"DummyGateway"
,
INFO
,
params
)
LOG
(
"DummyGateway"
,
INFO
,
params
)
return
None
return
None
else
:
else
:
return
generateRandomMessageId
()
return
self
.
_
generateRandomMessageId
()
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'getMessageStatus'
)
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'getMessageStatus'
)
def
getMessageStatus
(
self
,
message_id
):
def
getMessageStatus
(
self
,
message_id
):
"""Retrive the status of a message"""
"""Retrive the status of a message"""
return
"delivered"
return
"delivered"
security
.
declarePublic
(
'receive'
)
security
.
declarePublic
(
'receive'
)
...
@@ -127,7 +126,7 @@ class DummyGateway(XMLObject):
...
@@ -127,7 +126,7 @@ class DummyGateway(XMLObject):
#Dummy notify only new SMS
#Dummy notify only new SMS
self
.
notifyReception
(
REQUEST
.
get
(
"sender"
),
self
.
notifyReception
(
REQUEST
.
get
(
"sender"
),
REQUEST
.
get
(
"text"
),
REQUEST
.
get
(
"text"
),
_generateRandomMessageId
())
self
.
_generateRandomMessageId
())
finally
:
finally
:
#Restore orinal user
#Restore orinal user
setSecurityManager
(
sm
)
setSecurityManager
(
sm
)
...
@@ -155,9 +154,9 @@ class DummyGateway(XMLObject):
...
@@ -155,9 +154,9 @@ class DummyGateway(XMLObject):
message_type
=
'text/plain'
,
message_type
=
'text/plain'
,
reception_date
=
DateTime
())
reception_date
=
DateTime
())
def
_generateRandomMessageId
():
def
_generateRandomMessageId
(
self
):
letters
=
random
.
sample
(
string
.
ascii_lowercase
,
20
)
letters
=
random
.
sample
(
string
.
ascii_lowercase
,
20
)
return
"%s-%s-%s-%s"
%
(
''
.
join
(
letters
[
0
:
5
]),
return
"%s-%s-%s-%s"
%
(
''
.
join
(
letters
[
0
:
5
]),
''
.
join
(
letters
[
5
:
10
]),
''
.
join
(
letters
[
5
:
10
]),
''
.
join
(
letters
[
10
:
15
]),
''
.
join
(
letters
[
10
:
15
]),
''
.
join
(
letters
[
15
:
20
]))
''
.
join
(
letters
[
15
:
20
]))
\ 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