CHSCodeForChange / Sapphire-Web

The website/backend repository for Sapphire, a platform to help organizations manage volunteers.
https://sapphire-web.herokuapp.com
GNU General Public License v3.0
8 stars 2 forks source link

Can't open group info page because of image attribute #61

Closed jpaav closed 6 years ago

jpaav commented 6 years ago

Returns The 'image' attribute has no file associated with it

Full error report:

Environment:

Request Method: GET Request URL: http://127.0.0.1:8000/groups/1/

Django Version: 1.11.7 Python Version: 3.6.3 Installed Applications: ['crispy_forms', 'gunicorn', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'accounts', 'feed', 'alerts', 'sheets', 'info', 'groups', 'volunteerApp', 'organizer', 'utility'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware']

Template error: In template C:\Users\jpaavola\Documents\Code for Change\Sapphire-web\resources\templates\header_not_centered.html, error at line 8 The 'image' attribute has no file associated with it. 1 : 2 : <!DOCTYPE html> 3 : 4 : 5 : 6 : 7 : 8 : 9 : 10 : Sapphire 11 : 12 : 13 : 14 : 15 : 16 : 17 : 18 :

Traceback:

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\base.py" in _resolve_lookup

  1. current = current[bit]

During handling of the above exception ('ImageFieldFile' object is not subscriptable), another exception occurred:

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\exception.py" in inner

  1. response = get_response(request)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\base.py" in _legacy_get_response

  1. response = self._get_response(request)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\base.py" in _get_response

  1. response = self.process_exception_by_middleware(e, request)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\handlers\base.py" in _get_response

  1. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "C:\Users\jpaavola\Documents\Code for Change\Sapphire-web\groups\views.py" in group

  1. 'is_member':group.get_is_member(request.user), 'is_owner':is_owner, 'is_organizer':group.get_is_organzer(request.user)})

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\shortcuts.py" in render

  1. content = loader.render_to_string(template_name, context, request, using=using)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\loader.py" in render_to_string

  1. return template.render(context, request)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\backends\django.py" in render

  1. return self.template.render(context)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\base.py" in render

  1. return self._render(context)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\base.py" in _render

  1. return self.nodelist.render(context)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\base.py" in render

  1. bit = node.render_annotated(context)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\base.py" in render_annotated

  1. return self.render(context)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\loader_tags.py" in render

  1. return compiled_parent._render(context)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\base.py" in _render

  1. return self.nodelist.render(context)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\base.py" in render

  1. bit = node.render_annotated(context)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\base.py" in render_annotated

  1. return self.render(context)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\loader_tags.py" in render

  1. result = block.nodelist.render(context)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\base.py" in render

  1. bit = node.render_annotated(context)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\base.py" in render_annotated

  1. return self.render(context)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\base.py" in render

  1. output = self.filter_expression.resolve(context)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\base.py" in resolve

  1. obj = self.var.resolve(context)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\base.py" in resolve

  1. value = self._resolve_lookup(context)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\template\base.py" in _resolve_lookup

  1. current = getattr(current, bit)

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\fields\files.py" in url

  1. self._require_file()

File "C:\Users\jpaavola\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\db\models\fields\files.py" in _require_file

  1. raise ValueError("The '%s' attribute has no file associated with it." % self.field.name)

Exception Type: ValueError at /groups/1/ Exception Value: The 'image' attribute has no file associated with it.