hmpf
This commit is contained in:
parent
0cce214a9b
commit
ce0dd03bd7
|
|
@ -181,17 +181,7 @@ def getNCLoggedUserBySession(sid):
|
|||
final_json = json.loads(js)
|
||||
|
||||
# New user login - set initial status
|
||||
try:
|
||||
if(final_json['ocs']['meta']['status'] == 'failure'):
|
||||
nc_login_headers = {'Authorization' : 'Bearer ' + sid, 'OCS-APIREQUEST' : 'true'}
|
||||
r = requests.get(settings.NEXTCLOUD_URL + "ocs/v2.php/apps/user_status/api/v1/user_status/status", headers=nc_login_headers, data={'statusType' : 'dnd'})
|
||||
|
||||
r = requests.get(settings.NEXTCLOUD_URL + "ocs/v2.php/apps/user_status/api/v1/user_status", headers=nc_login_headers)
|
||||
|
||||
xpars = xmltodict.parse(r.text)
|
||||
js = json.dumps(xpars)
|
||||
final_json = json.loads(js)
|
||||
except:
|
||||
if(final_json['ocs']['meta']['status'] == 'failure'):
|
||||
nc_login_headers = {'Authorization' : 'Bearer ' + sid, 'OCS-APIREQUEST' : 'true'}
|
||||
r = requests.get(settings.NEXTCLOUD_URL + "ocs/v2.php/apps/user_status/api/v1/user_status/status", headers=nc_login_headers, data={'statusType' : 'dnd'})
|
||||
|
||||
|
|
@ -201,6 +191,5 @@ def getNCLoggedUserBySession(sid):
|
|||
js = json.dumps(xpars)
|
||||
final_json = json.loads(js)
|
||||
|
||||
return final_json['ocs']['data']['userId']
|
||||
|
||||
return final_json['ocs']['data']['userId']
|
||||
|
||||
Loading…
Reference in New Issue