stxnext-csr / volontulo

Web portal for collaboration of community volunteers with organizations and institutions.
MIT License
14 stars 24 forks source link

UserProfile not created – causes 500 Internal Server Error when accessing homepage view #581

Open JarUrb opened 8 years ago

JarUrb commented 8 years ago

Steps to reproduce

  1. run python manage.py createsuperuser --settings=volontulo_org.settings.dev
  2. enter username, email address, password
  3. run python manage.py runserver --settings=volontulo_org.settings.dev
  4. go to http://127.0.0.1:8000/admin in web browser
  5. log in using username and password provided in step 2
  6. go to http://127.0.0.1:8000/ in web browser

Traceback

Environment:

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

Django Version: 1.8.4
Python Version: 3.4.3
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'bootstrap3',
 'cookielaw',
 'apps.volontulo',
 'debug_toolbar',
 'django_coverage',
 'django_extensions',
 'django_nose')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.security.SecurityMiddleware')

Traceback:
File "/home/jarurb/python/volontulo/env/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response
  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/jarurb/python/volontulo/apps/volontulo/views/__init__.py" in homepage
  45.     if logged_as_admin(request):
File "/home/jarurb/python/volontulo/apps/volontulo/views/__init__.py" in logged_as_admin
  34.         UserProfile.objects.get(user=request.user).is_administrator
File "/home/jarurb/python/volontulo/env/lib/python3.4/site-packages/django/db/models/manager.py" in manager_method
  127.                 return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/jarurb/python/volontulo/env/lib/python3.4/site-packages/django/db/models/query.py" in get
  334.                 self.model._meta.object_name

Exception Type: DoesNotExist at /
Exception Value: UserProfile matching query does not exist.