Compare commits

..

3 Commits

Author SHA1 Message Date
Ben Lopatin acdcb03283 Version bump 0.6.0 2016-07-22 08:48:57 -04:00
Ben Lopatin 6bd73fdd5c Merge pull request #4 from Meal-Mentor/master
Added method to add group to the user
2016-07-22 08:46:22 -04:00
Scott Nixon c13b456b79 Added method to add group to the user 2016-07-19 11:33:27 -07:00
5 changed files with 27 additions and 3 deletions
+2
View File
@@ -4,3 +4,5 @@ Marc Sibson
James Potter
Ben Lopatin
Daniel Zohar
Matheus Fernandes
Scott Nixon
+5
View File
@@ -3,6 +3,11 @@
Release history
===============
0.6.0
-----
* Adds method to add user to group by user ID
0.5.0
-----
+2 -2
View File
@@ -51,9 +51,9 @@ copyright = u'2014, Marc Sibson'
# built documents.
#
# The short X.Y version.
version = '0.5'
version = '0.6'
# The full version, including alpha/beta/rc tags.
release = '0.5.0'
release = '0.6.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = '0.5.0'
__version__ = '0.6.0'
from pydiscourse.client import DiscourseClient
+17
View File
@@ -750,6 +750,23 @@ class DiscourseClient(object):
"""
return self._put("/admin/groups/{0}/members.json".format(groupid), usernames=username)
def add_user_to_group(self, groupid, userid):
"""
Add a member to a group by with user id.
Args:
groupid: the ID of the group
userid: the member id
Returns:
JSON API response
Raises:
DiscourseError if user is already member of group
"""
return self._post("/admin/users/{0}/groups".format(userid), group_id=groupid)
def delete_group_member(self, groupid, userid):
"""
Deletes a member from a group by user ID