geosolutions-it / geonode-generic

Generic Geonode-project based app, to be used with docker/rancher
https://waffle.io/geosolutions-it/geonode-generic
3 stars 6 forks source link

Theme activation fails if partner has no logo #32

Closed timlinux closed 6 years ago

timlinux commented 6 years ago

I tried to make a partner with no logo (dumb I know :-P ) and then associate it with my theme. When I pressed activate in admin I got this error:

Traceback (most recent call last): File "/usr/src/geonode/geonode/client/admin_actions.py",
 line 54, in enable_theme value = activate_theme(theme) 
File "/usr/src/geonode/geonode/client/utils.py", line 164, in activate_theme theme_css_content = t.render({'theme': theme}) 
File "/usr/local/lib/python2.7/site-packages/django/template/backends/django.py", line 66, in render return self.template.render(context) File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 207, in render return self._render(context) 
File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 199, in _render return self.nodelist.render(context) 
File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 990, in render bit = node.render_annotated(context) 
File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 957, in render_annotated return self.render(context) 
File "/usr/local/lib/python2.7/site-packages/django/template/defaulttags.py", line 322, in render return nodelist.render(context) 
File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 990, in render bit = node.render_annotated(context) 
File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 957, in render_annotated return self.render(context) 
File "/usr/local/lib/python2.7/site-packages/django/template/defaulttags.py", line 216, in render nodelist.append(node.render_annotated(context)) 
File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 957, in render_annotated return self.render(context) 
File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 1040, in render output = self.filter_expression.resolve(context) File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 708, in resolve obj = self.var.resolve(context) File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 849, in resolve value = self._resolve_lookup(context) 
File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 890, in _resolve_lookup current = getattr(current, bit) 
File "/usr/local/lib/python2.7/site-packages/django/db/models/fields/files.py", line 69, in url self._require_file() 
File "/usr/local/lib/python2.7/site-packages/django/db/models/fields/files.py", line 46, in _require_file raise ValueError("The '%s' attribute has no file associated with it." % self.field.name) 
ValueError: The 'logo' attribute has no file associated with it.

Removing the partner from the theme, saving it and then activating worked successfully.

giohappy commented 6 years ago

@timlinux issues about custom themes should go to the GeoNode master repo. Please open an issue over there and cite @afabiani. Thx

timlinux commented 6 years ago

@giohappy ok will do thanks.

timlinux commented 6 years ago

Reposted here https://github.com/GeoNode/geonode/issues/3821