Commit 422983dc authored by Gabriel Monnerat's avatar Gabriel Monnerat

DummyGateway: Fix code to access method correctly

parent 86af2076
...@@ -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,7 +154,7 @@ class DummyGateway(XMLObject): ...@@ -155,7 +154,7 @@ 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]),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment