Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced settings: AttributeError: attribute app_title not found #6695

Open
MacLake opened this issue Jun 27, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@MacLake
Copy link

commented Jun 27, 2019

Summary

When I open the advanced settings of a CMS page, it doesn’t work with some user accounts: On the production site I get an AttributeError: attribute app_title not found while rendering the template admin/includes/fieldset.html. On the production site the advanced settings usually show up, but always incomplete, ending with the redirection field, but I can’t configure app hooks. Whether the issue occurs or not, depends on the user account: With my admin account and a colleague’s account we have this problem, with a test account and another colleague’s account the advanced settings do open normally, i. e. completely.

Environment

  • Python version: 3.7 (development), 3.5 (production)
  • Django version: 1.11.21
  • django CMS version: 3.5.2, 3.6

Somebody else has reported this issue on Stack Overflow, but there wasn’t an answer.

Traceback

AttributeError at /en/admin/cms/page/257/advanced-settings/

attribute app_title not found

Request Method: 	GET
Request URL: 	http://localhost:8004/en/admin/cms/page/1/advanced-settings/
Django Version: 	1.11.21
Exception Type: 	AttributeError
Exception Value: 	

attribute app_title not found

Exception Location: 	/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/aldryn_apphooks_config/models.py in __getattr__, line 59
Python Executable: 	/home/jens/.virtualenvs/djangocms/bin/python
Python Version: 	3.7.3
Python Path: 	

['/home/jens/develop/djangocms',
 '/home/jens/develop/djangocms',
 '/usr/local/pycharm/helpers/pycharm_display',
 '/home/jens/.virtualenvs/djangocms/lib/python37.zip',
 '/home/jens/.virtualenvs/djangocms/lib/python3.7',
 '/home/jens/.virtualenvs/djangocms/lib/python3.7/lib-dynload',
 '/usr/lib64/python3.7',
 '/usr/lib/python3.7',
 '/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages',
 '/usr/local/pycharm/helpers/pycharm_matplotlib_backend']

Server time: 	Thu, 27 Jun 2019 16:06:04 +0200
Error during template rendering

In template /home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/contrib/admin/templates/admin/includes/fieldset.html, error at line 19
attribute app_title not found
9 	            {% for field in line %}
10 	                <div{% if not line.fields|length_is:'1' %} class="field-box{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>
11 	                    {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
12 	                    {% if field.is_checkbox %}
13 	                        {{ field.field }}{{ field.label_tag }}
14 	                    {% else %}
15 	                        {{ field.label_tag }}
16 	                        {% if field.is_readonly %}
17 	                            <div class="readonly">{{ field.contents }}</div>
18 	                        {% else %}
19 	                            {{ field.field }}
20 	                        {% endif %}
21 	                    {% endif %}
22 	                    {% if field.field.help_text %}
23 	                        <div class="help">{{ field.field.help_text|safe }}</div>
24 	                    {% endif %}
25 	                </div>
26 	            {% endfor %}
27 	        </div>
28 	    {% endfor %}
29 	</fieldset>



Environment:


Request Method: GET
Request URL: http://localhost:8004/en/admin/cms/page/1/advanced-settings/

Django Version: 1.11.21
Python Version: 3.7.3
Installed Applications:
('modeltranslation',
 'latex_settings',
 'dal',
 'dal_select2',
 'djangocms_admin_style',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.sites',
 'django.contrib.sitemaps',
 'django.contrib.staticfiles',
 'django.contrib.messages',
 'cms',
 'menus',
 'sekizai',
 'treebeard',
 'djangocms_text_ckeditor',
 'filer',
 'easy_thumbnails',
 'djangocms_column',
 'djangocms_link',
 'cmsplugin_filer_file',
 'cmsplugin_filer_folder',
 'cmsplugin_filer_image',
 'cmsplugin_filer_utils',
 'djangocms_style',
 'djangocms_snippet',
 'djangocms_googlemap',
 'djangocms_video',
 'reportlab',
 'djangocms_flexslider_phi',
 'djangocms_flexslider',
 'phi',
 'phi_plugins',
 'eventer',
 'exhibitors',
 'exhibitors_cn',
 'abstracts',
 'slam',
 'shared_data',
 'accounts',
 'common.apps.CommonConfig',
 'billing',
 'buildings.apps.BuildingsConfig',
 'certified_components_v2.apps.CertifiedComponentsV2Config',
 'ipha.apps.IPHAConfig',
 'persons.apps.PersonsConfig',
 'phpp.apps.PHPPConfig',
 'admindetail.apps.AdminDetailConfig',
 'aldryn_apphooks_config',
 'aldryn_categories',
 'aldryn_common',
 'aldryn_newsblog',
 'aldryn_people',
 'aldryn_translation_tools',
 'parler',
 'sortedm2m',
 'taggit',
 'aldryn_boilerplates',
 'ckeditor',
 'softhyphen',
 'django_countries',
 'django_prices_openexchangerates',
 'register',
 'django_extensions',
 'debug_toolbar',
 'email_obfuscator',
 'polymorphic')
Installed Middleware:
('django.middleware.security.SecurityMiddleware',
 'cms.middleware.utils.ApphookReloadMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'cms.middleware.user.CurrentUserMiddleware',
 'cms.middleware.page.CurrentPageMiddleware',
 'cms.middleware.toolbar.ToolbarMiddleware',
 'cms.middleware.language.LanguageCookieMiddleware',
 'debug_toolbar.middleware.DebugToolbarMiddleware')


Template error:
In template /home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/contrib/admin/templates/admin/includes/fieldset.html, error at line 19
   attribute app_title not found   9 :             {% for field in line %}
   10 :                 <div{% if not line.fields|length_is:'1' %} class="field-box{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>
   11 :                     {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
   12 :                     {% if field.is_checkbox %}
   13 :                         {{ field.field }}{{ field.label_tag }}
   14 :                     {% else %}
   15 :                         {{ field.label_tag }}
   16 :                         {% if field.is_readonly %}
   17 :                             <div class="readonly">{{ field.contents }}</div>
   18 :                         {% else %}
   19 :                              {{ field.field }} 
   20 :                         {% endif %}
   21 :                     {% endif %}
   22 :                     {% if field.field.help_text %}
   23 :                         <div class="help">{{ field.field.help_text|safe }}</div>
   24 :                     {% endif %}
   25 :                 </div>
   26 :             {% endfor %}
   27 :         </div>
   28 :     {% endfor %}
   29 : </fieldset>


Traceback:

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/app_data/containers.py" in __getattr__
  161.             return self.__getitem__(name)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/app_data/containers.py" in __getitem__
  154.         return self._data[name]

During handling of the above exception ('app_title'), another exception occurred:

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/aldryn_apphooks_config/models.py" in __getattr__
  56.             return getattr(self.app_data.config, item)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/app_data/containers.py" in __getattr__
  163.             raise AttributeError(name)

During handling of the above exception (app_title), another exception occurred:

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  217.                 response = self.process_exception_by_middleware(e, request)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  215.                 response = response.render()

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/response.py" in render
  107.             self.content = self.rendered_content

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/response.py" in rendered_content
  84.         content = template.render(context, self._request)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/backends/django.py" in render
  66.             return self.template.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render
  207.                     return self._render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/test/utils.py" in instrumented_test_render
  107.     return self.nodelist.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/loader_tags.py" in render
  177.             return compiled_parent._render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/test/utils.py" in instrumented_test_render
  107.     return self.nodelist.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/loader_tags.py" in render
  177.             return compiled_parent._render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/test/utils.py" in instrumented_test_render
  107.     return self.nodelist.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/loader_tags.py" in render
  177.             return compiled_parent._render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/test/utils.py" in instrumented_test_render
  107.     return self.nodelist.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/loader_tags.py" in render
  72.                 result = block.nodelist.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/defaulttags.py" in render
  216.                     nodelist.append(node.render_annotated(context))

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/loader_tags.py" in render
  216.                 return template.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render
  209.                 return self._render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/test/utils.py" in instrumented_test_render
  107.     return self.nodelist.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/loader_tags.py" in render
  177.             return compiled_parent._render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/test/utils.py" in instrumented_test_render
  107.     return self.nodelist.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/defaulttags.py" in render
  216.                     nodelist.append(node.render_annotated(context))

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/defaulttags.py" in render
  216.                     nodelist.append(node.render_annotated(context))

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/defaulttags.py" in render
  322.                 return nodelist.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/defaulttags.py" in render
  322.                 return nodelist.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render
  1046.         return render_value_in_context(output, context)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/template/base.py" in render_value_in_context
  1024.     value = force_text(value)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/utils/encoding.py" in force_text
  76.                     s = six.text_type(s)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/utils/html.py" in <lambda>
  394.         klass.__str__ = lambda self: mark_safe(klass_str(self))

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/forms/boundfield.py" in __str__
  41.         return self.as_widget()

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/forms/boundfield.py" in as_widget
  127.             **kwargs

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/cms/forms/widgets.py" in render
  313.             return super(ApplicationConfigSelect, self).render(name, value, attrs, renderer)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/forms/widgets.py" in render
  220.         context = self.get_context(name, value, attrs)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/cms/forms/widgets.py" in get_context
  299.         context['widget']['script_init'] = self._build_script(name, value, context['widget']['attrs'])

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/cms/forms/widgets.py" in _build_script
  280.                 ["['%s', '%s']" % (config.pk, escapejs(escape(config))) for config in cms_app.get_configs()])))  # noqa

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/cms/forms/widgets.py" in <listcomp>
  280.                 ["['%s', '%s']" % (config.pk, escapejs(escape(config))) for config in cms_app.get_configs()])))  # noqa

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/utils/functional.py" in wrapper
  219.                 return func(*args, **kwargs)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/utils/html.py" in escape
  43.         force_text(text).replace('&', '&amp;').replace('<', '&lt;')

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/django/utils/encoding.py" in force_text
  76.                     s = six.text_type(s)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/aldryn_newsblog/cms_appconfig.py" in __str__
  151.         return self.safe_translation_getter('app_title')

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/parler/models.py" in safe_translation_getter
  771.                 return getattr(self, field)

File "/home/jens/.virtualenvs/djangocms/lib/python3.7/site-packages/aldryn_apphooks_config/models.py" in __getattr__
  59.             raise AttributeError('attribute %s not found' % item)

Exception Type: AttributeError at /en/admin/cms/page/1/advanced-settings/
Exception Value: attribute app_title not found

Also worth mentioning are the local variables:

Variable Value
name 'app_title'
self <NewsBlogConfigFormAppDataContainer: {'default_published': None}>

So Aldryn NewsBlog may cause the issue, but I’m not sure.

Has anybody have an idea what’s wrong and how I can solve this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.