Skip to content

Commit

Permalink
especificando a exception
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiobatalha committed Jun 18, 2014
1 parent 0934fde commit 068b656
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scielomanager/api/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from django.db.models import Q
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from tastypie.resources import ModelResource, Resource
from tastypie import fields
from tastypie.contrib.contenttypes.fields import GenericForeignKeyField
Expand Down Expand Up @@ -276,15 +276,15 @@ def dehydrate_collections(self, bundle):
def dehydrate_pub_status(self, bundle):
try:
col = bundle.obj.collections.get()
except:
except MultipleObjectsReturned:
col = current_user_active_collection()

return bundle.obj.membership_info(col, 'status')

def dehydrate_pub_status_reason(self, bundle):
try:
col = bundle.obj.collections.get()
except:
except MultipleObjectsReturned:
col = current_user_active_collection()

return bundle.obj.membership_info(col, 'reason')
Expand Down

0 comments on commit 068b656

Please sign in to comment.