for update
This commit is contained in:
parent
ee52791a56
commit
f24e095987
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue