SanomaCZ / ella-hope

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

unable to upload photo from standalone form #20

Closed yedpodtrzitko closed 11 years ago

yedpodtrzitko commented 11 years ago

filled fields:

expected result on form submit:

current result (ajax JSON response):

{
"error_message": "'NoneType' object is not iterable", "traceback": "Traceback (most recent call last):

  File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 202, in wrapper
    response = callback(request, *args, **kwargs)

  File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 441, in dispatch_list
    return self.dispatch('list', request, **kwargs)

  File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 474, in dispatch
    response = method(request, **kwargs)

  File \"/home/yed/skript/sanoma/daz2/venv/src/ella-hub/ella_hub/resources.py\", line 344, in patch_list
    request, **kwargs)

  File \"/home/yed/skript/sanoma/daz2/venv/lib/python2.7/site-packages/django/db/transaction.py\", line 209, in inner
    return func(*args, **kwargs)

  File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 2057, in patch_list
    return super(ModelResource, self).patch_list(request, **kwargs)

  File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 1394, in patch_list
    self.obj_create(bundle, request=request)

  File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 1938, in obj_create
    m2m_bundle = self.hydrate_m2m(bundle)

  File \"/home/yed/skript/sanoma/daz2/venv/src/ella-hub/ella_hub/extern_resources/daz_taggit_resources.py\", line 83, in patched_hydrate_m2m
    for index, tag in enumerate(bundle.data.get(\"tags\", ())):

TypeError: 'NoneType' object is not iterable
"}
yedpodtrzitko commented 11 years ago

if tag is filled, there's a different error:

{"error_message": "Attached object with ID '3dmlhp.jpeg' not found.", "traceback": "Traceback (most recent call last):

  File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 202, in wrapper
    response = callback(request, *args, **kwargs)

  File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 441, in dispatch_list
    return self.dispatch('list', request, **kwargs)

  File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 474, in dispatch
    response = method(request, **kwargs)

  File \"/home/yed/skript/sanoma/daz2/venv/src/ella-hub/ella_hub/resources.py\", line 344, in patch_list
    request, **kwargs)

  File \"/home/yed/skript/sanoma/daz2/venv/lib/python2.7/site-packages/django/db/transaction.py\", line 209, in inner
    return func(*args, **kwargs)

  File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 2057, in patch_list
    return super(ModelResource, self).patch_list(request, **kwargs)

  File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 1359, in patch_list
    deserialized = self.deserialize(request, request.raw_post_data, format=request.META.get('CONTENT_TYPE', 'application/json'))

  File \"/home/yed/skript/sanoma/daz2/venv/src/ella-hub/ella_hub/resources.py\", line 284, in deserialize
    self.__attach_object(attached_objects, object, key, value)

  File \"/home/yed/skript/sanoma/daz2/venv/src/ella-hub/ella_hub/resources.py\", line 302, in __attach_object
    raise ValueError(\"Attached object with ID '%s' not found.\" % attached_object_id)

ValueError: Attached object with ID '3dmlhp.jpeg' not found.
"}