hmpf
This commit is contained in:
parent
0cce214a9b
commit
ce0dd03bd7
|
|
@ -181,7 +181,6 @@ def getNCLoggedUserBySession(sid):
|
||||||
final_json = json.loads(js)
|
final_json = json.loads(js)
|
||||||
|
|
||||||
# New user login - set initial status
|
# New user login - set initial status
|
||||||
try:
|
|
||||||
if(final_json['ocs']['meta']['status'] == 'failure'):
|
if(final_json['ocs']['meta']['status'] == 'failure'):
|
||||||
nc_login_headers = {'Authorization' : 'Bearer ' + sid, 'OCS-APIREQUEST' : 'true'}
|
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/status", headers=nc_login_headers, data={'statusType' : 'dnd'})
|
||||||
|
|
@ -191,16 +190,6 @@ def getNCLoggedUserBySession(sid):
|
||||||
xpars = xmltodict.parse(r.text)
|
xpars = xmltodict.parse(r.text)
|
||||||
js = json.dumps(xpars)
|
js = json.dumps(xpars)
|
||||||
final_json = json.loads(js)
|
final_json = json.loads(js)
|
||||||
except:
|
|
||||||
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)
|
|
||||||
|
|
||||||
return final_json['ocs']['data']['userId']
|
return final_json['ocs']['data']['userId']
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue