for update

This commit is contained in:
j 2019-01-30 18:00:38 +05:30
parent ee52791a56
commit f24e095987

View file

@ -34,7 +34,7 @@ def api_requestPeering(user_id, username, message):
return False
def api_acceptPeering(user_id, username, message):
user = User.get(user_id)
user = User.get(user_id, for_update=True)
if user:
logger.debug('incoming acceptPeering event: pending: %s', user.pending)
if user.pending == 'sent':
@ -50,7 +50,7 @@ def api_acceptPeering(user_id, username, message):
return False
def api_rejectPeering(user_id, message):
user = User.get(user_id)
user = User.get(user_id, for_update=True)
if user:
user.info['message'] = message
user.update_peering(False)
@ -59,7 +59,7 @@ def api_rejectPeering(user_id, message):
return False
def api_removePeering(user_id, message):
user = User.get(user_id)
user = User.get(user_id, for_update=True)
if user:
user.info['message'] = message
user.update_peering(False)
@ -68,7 +68,7 @@ def api_removePeering(user_id, message):
return False
def api_cancelPeering(user_id, message):
user = User.get(user_id)
user = User.get(user_id, for_update=True)
if user:
user.info['message'] = message
user.update_peering(False)