SanomaCZ / ella-hope

Brand new admin for Ella 3+
Other
3 stars 0 forks source link

Updating photos not working #36

Closed mrpohoda closed 11 years ago

mrpohoda commented 11 years ago

V editaci fotografie se mi žádné změny neuloží (změna názvu, autora, zdroje, vybrané části apod)

mrpohoda commented 11 years ago

When editing photo, there is an error message saying that file does not exist @miso-belica

Photo: http://localhost/ella-hope/ella_hope/app/index.html#!photos/edit/12 Image: http://crawler.bfhost.cz:1024/media/photos/2012/12/30/12-kaple.jpg

{"error_message": "[Errno 2] No such file or directory: 'photos/2012/12/30/12-kaple.jpg'", "traceback": "Traceback (most recent call last):\n\n File \"/home/seocity/sanoma/.env_stable-daz/lib/python2.7/site-packages/tastypie/resources.py\", line 202, in wrapper\n response = callback(request, _args, _kwargs)\n\n File \"/home/seocity/sanoma/.env_stable-daz/lib/python2.7/site-packages/tastypie/resources.py\", line 450, in dispatch_detail\n return self.dispatch('detail', request, _kwargs)\n\n File \"/home/seocity/sanoma/.env_stable-daz/lib/python2.7/site-packages/tastypie/resources.py\", line 474, in dispatch\n response = method(request, _kwargs)\n\n File \"/home/seocity/sanoma/ella-hub/ella_hub/resources.py\", line 332, in patch_detail\n request, _kwargs)\n\n File \"/home/seocity/sanoma/.env_stable-daz/lib/python2.7/site-packages/tastypie/resources.py\", line 1437, in patch_detail\n self.update_in_place(request, bundle, deserialized)\n\n File \"/home/seocity/sanoma/.env_stable-daz/lib/python2.7/site-packages/tastypie/resources.py\", line 1460, in update_in_place\n return self.obj_update(original_bundle, *_kwargs)\n\n File \"/home/seocity/sanoma/.env_stable-daz/lib/python2.7/site-packages/tastypie/resources.py\", line 1999, in obj_update\n bundle = self.full_hydrate(bundle)\n\n File \"/home/seocity/sanoma/.env_stable-daz/lib/python2.7/site-packages/tastypie/resources.py\", line 769, in full_hydrate\n bundle = self.hydrate(bundle)\n\n File \"/home/seocity/sanoma/ella-hub/ella_hub/ella_resources/init.py\", line 142, in hydrate\n image = Image.open(uploaded_image)\n\n File \"/home/seocity/sanoma/.env_stable-daz/lib/python2.7/site-packages/PIL/Image.py\", line 1952, in open\n fp = builtin.open(fp, \"rb\")\n\nIOError: [Errno 2] No such file or directory: 'photos/2012/12/30/12-kaple.jpg'\n"}

miso-belica commented 11 years ago

There are sent some useless fields (I think) when photo is edited.

{
    'MAX_FILE_SIZE': '50000000', // useless
    'slug': '',
    'rotate': '0', // useless (no rotation)
    'important_bottom': '', // this breaks hub ('' is not number)
    'description': '', 
    'title': 'pepek', 
    'url': '', // ???
    'filename': '', // useless
    'important_left': '', // this breaks hub ('' is not number)
    'source': '', // this breaks hub ('' is not valid resource_uri)
    'important_right': '', // this breaks hub ('' is not number)
    'important_top': '', // this breaks hub ('' is not number)
    'app_data': None, // this may override stored data
    'authors': ['/admin-api/author/1/'], 
    'id': '2', 
    'name': ''  // ???
}