Skip to content

Added admin_deletegroup, fixed admin_createnewgroup #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion filecloudapi/fcserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1979,7 +1979,7 @@ def admin_createnewgroup(self, groupname: str):
{"op": "addgroup", "groupname": groupname},
)

if int(resp.findtext("./group/groupname", "0")) != 1:
if resp.findtext("./group/groupname") is None:
raise ServerError("", "Failed to create group")

def admin_groupisinshare(
Expand Down Expand Up @@ -2367,3 +2367,18 @@ def get_share_activities(self, share: FCShare) -> list[ShareActivity]:
entries.append(shares_acts)

return entries

def admin_deletegroup(self, groupid: str) -> bool:
"""
Delete a user group
"""
resp = self._api_call(
"/admin/deletegroup",
{"op": "deletegroup", "groupid": groupid},
)

result = resp.findtext("./command/result")
if result == "0":
return True
else:
return False
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]

name = "filecloudapi-python"
version = "0.4.3"
version = "0.4.4"
description = "A Python library to connect to a Filecloud server"

packages = [{ include = "filecloudapi" }]
Expand Down