Skip to content
This repository

resolve django 1.5 error: get_inline_instances() takes exactly 2 arguments #1568

Closed
wants to merge 2 commits into from

3 participants

Thomas Schreiber Patrick Lauber Ioan Alexandru Cucu
Thomas Schreiber

I am doing an installation for the first time and using Django 1.5.

I haven't tested with versions less than 1.5 but this should not effect them.

Thomas Schreiber

This fix allows me to render the /admin/cms/page/add/ page, but when attempting to save I get a max recursion depth error. I am not sure if they are related, but I think so.

here is the traceback: http://dpaste.com/849790/

Patrick Lauber
Owner

seams the testsuite fails

Ioan Alexandru Cucu
kux commented January 08, 2013

obj and _current_page should reference the same object.
_current_page was a workaround for the fact that get_inline_instances didn't receive 'obj' as a parameter.

However, mind that your code ONLY works for 1.5 and would break for any smaller version (see broken unit tests)

Ioan Alexandru Cucu

The infinite recursion issue is different and has nothing to do with get_inline_instances
I managed to reproduce it as well...

It's caused by the fact that the page's unicode method tries to use a title that hasn't been created yet.

The Title.DoesNotExist error which is being raised tries calls the page's unicode method (required for generating the error message) which AGAIN raises Title.DoesNotExist which AGAIN calls the page's unicode and so forth...

Ioan Alexandru Cucu kux referenced this pull request February 28, 2013
Closed

Fix for #1609 #1645

Patrick Lauber
Owner

this seams to be fixed in develop? correct?

Ioan Alexandru Cucu
kux commented March 28, 2013

Yes. It should be fixed by #1674

This issue should be closed.

Patrick Lauber digi604 closed this March 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  cms/admin/pageadmin.py
4  cms/admin/pageadmin.py
@@ -443,8 +443,8 @@ def get_form(self, request, obj=None, **kwargs):
443 443
 
444 444
         return form
445 445
 
446  
-    def get_inline_instances(self, request):
447  
-        inlines = super(PageAdmin, self).get_inline_instances(request)
  446
+    def get_inline_instances(self, request, obj=None):
  447
+        inlines = super(PageAdmin, self).get_inline_instances(request, obj)
448 448
         if settings.CMS_PERMISSION and hasattr(self, '_current_page')\
449 449
                 and self._current_page:
450 450
             filtered_inlines = []
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.