[NC] Work arround issue nextcloud/server#33751

That issue is fixed in NC 25, but it will likely not be backported to
NC 24.

It produces issues when modifying users and not modifying their
display name.

See also:	https://github.com/nextcloud/server/issues/33751
merge-requests/61/merge
Evilham 2023-01-13 11:26:12 +01:00
parent f4a3d38384
commit c9af7242c0
No known key found for this signature in database
GPG Key ID: AE3EE30D970886BF
1 changed files with 6 additions and 3 deletions

View File

@ -275,10 +275,13 @@ class Nextcloud:
self._request("PUT", url, data=data, headers=headers) self._request("PUT", url, data=data, headers=headers)
) )
if result["ocs"]["meta"]["statuscode"] == 102: if result["ocs"]["meta"]["statuscode"] == 102:
if result["ocs"]["meta"].get("message") != "Invalid displayname":
# Workaround for https://github.com/nextcloud/server/issues/33751
# Fixed on NC 25
raise ProviderItemExists raise ProviderItemExists
if result["ocs"]["meta"]["statuscode"] == 104: elif result["ocs"]["meta"]["statuscode"] == 104:
raise ProviderGroupNotExists raise ProviderGroupNotExists
if result["ocs"]["meta"]["statuscode"] != 100: elif result["ocs"]["meta"]["statuscode"] != 100:
log.error("Get Nextcloud provider user add error: " + str(result)) log.error("Get Nextcloud provider user add error: " + str(result))
raise ProviderOpError raise ProviderOpError
except: except: