You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get_view_form() function calls systemviews.get_view_names() function that attempts to load and parse application urls. Problem is that urls file contains call to admin.autodiscover() that loads django-seo admin module, so when get_view_form() is called, application urls are not yet loaded.
Also, there's another problem with get_view_names(), although it is much easier to solve:
diff --git a/rollyourown/seo/systemviews.py b/rollyourown/seo/systemviews.py
index b03a824..d56ca57 100644
--- a/rollyourown/seo/systemviews.py
+++ b/rollyourown/seo/systemviews.py
@@ -32,7 +32,7 @@ def get_view_names(seo_views):
output.append(name)
else:
for url in urls.urlpatterns:
- if url.name:
+ if getattr(url, 'name', None):
output.append(url.name)
return output
The text was updated successfully, but these errors were encountered:
The only suggestion I can make for now would be to overload get_form on the model admin and generate it at runtime.
Ideally, the end developer isn't restricted in this way, I'll keep this ticket open so if I ever get the time, I'll look into structuring things so that it just works. At the very least, there should be something in the docs about doing this.
RE problem #2, sounds good, heppy to include it, can you make a pull request?
django-seo
admin.py
contains code:get_view_form()
function callssystemviews.get_view_names()
function that attempts to load and parse application urls. Problem is that urls file contains call toadmin.autodiscover()
that loads django-seo admin module, so whenget_view_form()
is called, application urls are not yet loaded.Also, there's another problem with
get_view_names()
, although it is much easier to solve:The text was updated successfully, but these errors were encountered: