1. Mikhail Korobov
  2. django-generic-images
  3. Issues
Issue #6 open

admin uploader doesn't work with django-grappelli

created an issue


I'm getting the following error while uploading images:

{{{ File "C:\Development\Projects\djbase\site-packages\django\forms\formsets.py", line 54, in _management_form raise ValidationError('ManagementForm data is missing or has been tampered with') ValidationError: [u'ManagementForm data is missing or has been tampered with'] [22/Dec/2009 19:49:54] "POST /admin/grapewire/category/1/ HTTP/1.1" 500 3474 }}}

I'm running pretty much everything from head/trunk.

Any ideas?

Best regards, -Stefán Baxter

Comments (4)

  1. Mikhail Korobov repo owner

    Do you use the latest trunk of django-generic-images? It was updated since your first report with effort to fix the issue. Also please note that new AttachedImagesInline.js should be copied to the project manually, it is not possible to auto-update media files (as I know).

    If you use the latest trunk and the latest AttachedImagesInline.js in the project then could you please provide more information such as version of django, form/model definition, admin options. The HTML code of page will also be very helpful because the problem is client-side: in your case the form constructed by js script does not match django's expectations.

  2. acmeguy reporter


    Everything is up to date. This is a clash between Mootools and jQuery (Used for Grappelli). Let me know if you have a jQuery version lying around :o).

    Regards, -Stefan

  3. Mikhail Korobov repo owner
    • changed status to open

    Actually I have 2 jquery libraries (supplied by django-markitup and django-debug-toolbar) and 1 mootools (by django-generic images) on one admin page and all is working fine together :) Grappelli doesn't use any kind of "noconflict" mode and that's the problem (http://groups.google.com/group/django-grappelli/browse_thread/thread/780ec50f8d06e11a). Thanks for figuring out the exact problem, I'll look into this and try to fix it.

    It's not the only issue with grappelli because grappelli overrides templates for inlines and django-generic-images overrides them back so the page becomes a bit ugly. It is possible to supply different template by assigning to 'template' attribute of AttachedImagesInline:

    ImagesInline = attachedimages_inline_factory()
    ImagesInline.template = 'my_inline_template_for_grappelli.html'

    but it'll be better if this template will be provided out of box (opened #7 for this).

  4. Log in to comment