Skip to content

Commit

Permalink
Merge pull request #28 from RockefellerArchiveCenter/logging
Browse files Browse the repository at this point in the history
improve responses in views, serializer fields visible
  • Loading branch information
helrond authored Dec 20, 2018
2 parents 27bee70 + 4c5f515 commit f939af9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bagdiscovery/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class BagSerializer(serializers.HyperlinkedModelSerializer):

class Meta:
model = Bag
fields = ('url', 'bag_identifier', 'accession', 'data', 'created', 'last_modified')
fields = ('url', 'bag_identifier', 'bag_path', 'accession', 'data', 'created', 'last_modified')


class BagListSerializer(serializers.HyperlinkedModelSerializer):
Expand Down
2 changes: 1 addition & 1 deletion bagdiscovery/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def create(self, request):
serialized = AccessionSerializer(accession, context={'request': request})
return Response(serialized.data)
except ValidationError as e:
return Response({"detail": "{}: {}".format(self.format_field_path(e.absolute_path), e.message)}, status=400)
return Response({"detail": "Invalid accession data: {}: {}".format(self.format_field_path(e.absolute_path), e.message)}, status=400)
except IntegrityError as e:
return Response({"detail": e.args[0]}, status=409)
except Exception as e:
Expand Down

0 comments on commit f939af9

Please sign in to comment.