Browse files

Fixed assignees bug in private patterns

  • Loading branch information...
1 parent a105d7e commit 61c61870aea62694a6b3cd19bac3f5c42e3a56f1 @fatiherikli committed May 7, 2013
Showing with 4 additions and 6 deletions.
  1. +3 −2 web/dbpatterns/documents/mixins.py
  2. +1 −4 web/dbpatterns/documents/models.py
View
5 web/dbpatterns/documents/mixins.py
@@ -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.")
View
5 web/dbpatterns/documents/models.py
@@ -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):

0 comments on commit 61c6187

Please sign in to comment.