Skip to content

Commit

Permalink
* Add the is_active flag to be correct.
Browse files Browse the repository at this point in the history
* If the object is a queryset or a list then iterate over all of them.
  • Loading branch information
bgroff committed Apr 10, 2017
1 parent 5bbeac2 commit 1e954aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions django_kala/basecamp_classic/people/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ def _xml_convert(self, element):

if field.tag == 'administrator':
data['is_admin'] = bool(distutils.util.strtobool(field.text))
if field.tag == 'deleted':
data['is_active'] = not(bool(distutils.util.strtobool(field.text)))
if field.tag == 'has-access-to-new-projects':
data['access_new_projects'] = bool(distutils.util.strtobool(field.text))
return data
2 changes: 1 addition & 1 deletion django_kala/basecamp_classic/people/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def render(self, data, accepted_media_type=None, renderer_context=None):
return stream.getvalue()

# If users are a list, deal with that
if type(data['users']) is QuerySet:
if type(data['users']) is QuerySet or type(data['users']) is list:
xml.startElement('people', {'type': 'array'})

self._to_xml(data['users'], data['request_user'], xml)
Expand Down

0 comments on commit 1e954aa

Please sign in to comment.