--- a/src/ldt/ldt/api/ldt/resources/project.py Wed Oct 15 16:41:38 2014 +0200
+++ b/src/ldt/ldt/api/ldt/resources/project.py Thu Oct 16 16:14:28 2014 +0200
@@ -81,6 +81,11 @@
raise BadRequest("PUT with a list of projects is forbidden.")
+ def hydrate_image(self, bundle):
+ if bundle.data['image'] and bundle.data['image'].startswith(settings.MEDIA_URL):
+ bundle.data['image'] = bundle.data['image'][len(settings.MEDIA_URL):]
+ return bundle
+
# Updates an existing project. Used with post_detail and with a ldt_id in the url
def post_detail(self, request, **kwargs):
# Inspired by put_detail but we only update an object. We can not create one.