Commit d756e69a authored by Nicolas Delaby's avatar Nicolas Delaby

Set alert code on Subscription objects

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15497 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 72c08d9c
......@@ -669,13 +669,14 @@ class Subscription(Folder, SyncCode):
def __init__(self, id, title, publication_url, subscription_url,
destination_path, source_uri, target_uri, query, xml_mapping,
conduit, gpg_key, id_generator, gid_generator, media_type, login,
password, activity_enabled):
password, activity_enabled, alert_code):
"""
We need to create a dictionnary of
signatures of documents which belong to the synchronisation
process
"""
self.id = id
self.setAlertCode(alert_code)
self.setActivityEnabled(activity_enabled)
self.publication_url = (publication_url)
self.subscription_url = str(subscription_url)
......@@ -702,6 +703,19 @@ class Subscription(Folder, SyncCode):
#self.signatures = PersitentMapping()
def getAlertCodeList(self):
#XXX replace by a dictionary or a list in SyncCode
return [self.TWO_WAY, self.ONE_WAY_FROM_SERVER]
def getAlertCode(self):
return getattr(self, 'alert_code', 200)
def setAlertCode(self, value):
self.alert_code = int(value)
def isOneWayFromServer(self):
return self.getDomainType() == self.SUB and self.getAlertCode() == self.ONE_WAY_FROM_SERVER
def getActivityEnabled(self):
"""
return true if we are using activity, false otherwise
......
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