Skip to content

Commit

Permalink
Fixed assignees bug in private patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
fatiherikli committed May 7, 2013
1 parent a105d7e commit 61c6187
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 3 additions & 2 deletions web/dbpatterns/documents/mixins.py
Expand Up @@ -12,6 +12,7 @@ class DocumentMixin(object):
def get_document(self):
resource = DocumentResource()
try:
return resource.obj_get(request=self.request, pk=self.kwargs.get("slug"))
except (TypeError, InvalidId, ImmediateHttpResponse):
return resource.obj_get(request=self.request,
pk=self.kwargs.get("slug"))
except (InvalidId, ImmediateHttpResponse):
raise Http404("Document is not found.")
5 changes: 1 addition & 4 deletions web/dbpatterns/documents/models.py
Expand Up @@ -106,10 +106,7 @@ def get_stars(self):
@property
def assignees(self):
"""Returns assigned users or empty list"""
try:
return self['assignees']
except KeyError:
return []
return self.get('assignees') or []

@property
def star_count(self):
Expand Down

0 comments on commit 61c6187

Please sign in to comment.