Rollback error: 'NoneType' object is not iterable

39 views
Skip to first unread message

Daniel Hirsch

unread,
Apr 9, 2009, 4:57:02 PM4/9/09
to Django Reversion Discussion
Hi all,

I just installed reversion today, and everything seems to be working
except when I try to rollback to a previous revision. I receive the
following error:

=============
TypeError at /admin/lisa/emptycontentpage/1/history/1/

'NoneType' object is not iterable

Request Method: GET
Request URL: http://127.0.0.1:8000/admin/lisa/emptycontentpage/1/history/1/
Exception Type: TypeError
Exception Value:

'NoneType' object is not iterable

Exception Location: /usr/lib/python2.5/site-packages/reversion/
admin.py in render_revision_form, line 167
Python Executable: /usr/bin/python
Python Version: 2.5.2
Python Path: ['/cygdrive/e/Python/osteoball', '/usr/lib/
python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-cygwin',
'/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/
lib/python2.5/site-packages']
Server time: Thu, 9 Apr 2009 13:53:15 -0700
=============

And here's the traceback for what its worth:

=============
Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/admin/lisa/emptycontentpage/1/history/1/
Django Version: 1.1 beta 1 SVN-10285
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.admindocs',
'lisa',
'django_extensions',
'reversion']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'djangologging.middleware.LoggingMiddleware')


Traceback:
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py"
in get_response
92. response = callback(request, *callback_args,
**callback_kwargs)
File "/usr/lib/python2.5/site-packages/django/db/transaction.py" in
_commit_on_success
240. res = func(*args, **kw)
File "/usr/lib/python2.5/site-packages/reversion/revisions.py" in
_create_on_success
177. result = func(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/reversion/admin.py" in
revision_view
243. return self.render_revision_form(request, obj, version,
revision, context, self.revision_form_template, "../../")
File "/usr/lib/python2.5/site-packages/reversion/admin.py" in
render_revision_form
167. for initial_row in initial:

Exception Type: TypeError at /admin/lisa/emptycontentpage/1/history/1/
Exception Value: 'NoneType' object is not iterable
=============

I've tried multiple times and get the same message.

Any thoughts?

David Hall

unread,
Apr 9, 2009, 6:12:36 PM4/9/09
to django-r...@googlegroups.com
Heya,

That's an odd error to be getting.  I wonder, what version of Django are you using?

David.

2009/4/9 Daniel Hirsch <dhi...@cequal.com>



--
David Hall
Etianen.com

Telephone:  07896 106290
Web:  http://www.etianen.com

Daniel Hirsch

unread,
Apr 9, 2009, 7:11:18 PM4/9/09
to django-r...@googlegroups.com
Running 1.1 beta 1 SVN-10285

David Hall

unread,
Apr 10, 2009, 6:47:23 AM4/10/09
to django-r...@googlegroups.com
Hmm.

If you're running from the Django trunk, try working with the Reversion trunk too.  In my tests they work fine together.

David.

2009/4/10 Daniel Hirsch <dhi...@cequal.com>

Daniel Hirsch

unread,
Apr 10, 2009, 12:50:39 PM4/10/09
to django-r...@googlegroups.com
Just upgraded to trunk version, no change. Same error message. I also
tried creating a new record that didn't exist before installing
reversion, modifying it, and then trying to revert. Same error.

patrickk

unread,
Apr 17, 2009, 6:31:05 AM4/17/09
to Django Reversion Discussion
I´m getting the same error here ... I´ve also switched from reversion
1.1.1 to trunk and nothing changed.

patrick


On 10 Apr., 18:50, Daniel Hirsch <dhir...@cequal.com> wrote:
> Just upgraded to trunk version, no change. Same error message. I also
> tried creating a new record that didn't exist before installing
> reversion, modifying it, and then trying to revert. Same error.
>
> On Fri, Apr 10, 2009 at 3:47 AM, David Hall <da...@etianen.com> wrote:
> > Hmm.
>
> > If you're running from the Django trunk, try working with the Reversion
> > trunk too.  In my tests they work fine together.
>
> > David.
>
> > 2009/4/10 Daniel Hirsch <dhir...@cequal.com>
>
> >> Running 1.1 beta 1 SVN-10285
>
> >> On Thu, Apr 9, 2009 at 3:12 PM, David Hall <da...@etianen.com> wrote:
> >> > Heya,
>
> >> > That's an odd error to be getting.  I wonder, what version of Django are
> >> > you
> >> > using?
>
> >> > David.
>
> >> > 2009/4/9 Daniel Hirsch <dhir...@cequal.com>

patrickk

unread,
Apr 17, 2009, 6:35:19 AM4/17/09
to Django Reversion Discussion
I don´t know if this second "error" is somehow related to the one
mentioned above, but maybe it helps:
when using reversion from within the admin-interface, the "comment" is
saved correctly. with using reversion outside the admin, no comment is
saved. I´ve tried it with the middleware as well as the decorator.

thanks,
patrick

David Hall

unread,
Apr 17, 2009, 5:08:41 PM4/17/09
to django-r...@googlegroups.com
Hi Patrick,

What you're describing isn't an error.  The comment is a plain text field for ANY comments about the revision.  The admin interface fills in the comment field with a description of the changes that took place, but outside of the admin interface it's up to you to fill in the comment field with any relevant information.

To fix the 'NoneType' object is not iterable error, I'm going to need a stack trace.

David.

2009/4/17 patrickk <sehma...@gmail.com>

patrickk

unread,
Apr 18, 2009, 4:16:18 PM4/18/09
to Django Reversion Discussion
about the comment ... maybe something like this could be added to the
docs:

revision_comment = []
if form.has_changed():
if form.changed_data:
comments = []
for item in form.changed_data:
comments.append(form[item].label)
if comments:
revision_comment.append(_('Changed %s.') % get_text_list
(comments, _('and')))

concerning the rollback-error, I´m doing some more debugging and post
here again.

thanks,
patrick

On 17 Apr, 23:08, David Hall <da...@etianen.com> wrote:
> Hi Patrick,
>
> What you're describing isn't an error.  The comment is a plain text field
> for ANY comments about the revision.  The admin interface fills in the
> comment field with a description of the changes that took place, but outside
> of the admin interface it's up to you to fill in the comment field with any
> relevant information.
>
> To fix the 'NoneType' object is not iterable error, I'm going to need a
> stack trace.
>
> David.
>
> 2009/4/17 patrickk <sehmasch...@gmail.com>
Reply all
Reply to author
Forward
0 new messages