orzubalsky / tradeschool

Trade School is an alternative school that runs on barter
Other
16 stars 5 forks source link

Error message shows when submitting a new class #166

Closed laurabillings closed 9 years ago

laurabillings commented 10 years ago

Hello - when teachers submit a new class, they are getting an error message (pasted below). But the class is being submitted and shows up on the back end. So teachers are pressing the submit button lots of times which creates multiple pending classes on the back end. Thanks!

KeyError at /westminster/page/class/add

'title' Request Method: POST Request URL: http://tradeschool.coop/westminster/page/class/add Django Version: 1.5.1 Exception Type: KeyError Exception Value:
'title' Exception Location: /opt/projects/tse/ts/apps/tradeschool/views.py in course_add, line 319 Python Executable: /usr/bin/python Python Version: 2.7.3 Python Path:
['/opt/projects/tse/eggs/MySQL_python-1.2.3-py2.7-linux-x86_64.egg', '/opt/projects/tse/eggs/South-0.8.4-py2.7.egg', '/opt/projects/tse/eggs/simplejson-3.3.2-py2.7-linux-x86_64.egg', '/opt/projects/tse/eggs/PIL-1.1.7-py2.7-linux-x86_64.egg', '/opt/projects/tse/eggs/requests-2.2.1-py2.7.egg', '/opt/projects/tse/eggs/django_tinymce-1.5.2-py2.7.egg', '/opt/projects/tse/eggs/django_flatpages_tinymce-0.1.1-py2.7.egg', '/opt/projects/tse/eggs/pytz-2013.9-py2.7.egg', '/opt/projects/tse/eggs/django_countries-1.5-py2.7.egg', '/opt/projects/tse/eggs/django_grappelli-2.4.8-py2.7.egg', '/opt/projects/tse/eggs/feedparser-5.1.3-py2.7.egg', '/opt/projects/tse/eggs/django_dajaxice-0.5.5-py2.7.egg', '/opt/projects/tse/eggs/python_memcached-1.53-py2.7.egg', '/opt/projects/tse/eggs/six-1.5.2-py2.7.egg', '/opt/projects/tse/eggs/selenium-2.39.0-py2.7.egg', '/opt/projects/tse/eggs/docutils-0.11-py2.7.egg', '/opt/projects/tse/eggs/django_debug_toolbar-1.0.1-py2.7.egg', '/opt/projects/tse/eggs/django_tastypie-0.9.16-py2.7.egg', '/opt/projects/tse/eggs/django_ace-1.0.0-py2.7.egg', '/opt/projects/tse/eggs/djangorecipe-1.7-py2.7.egg', '/opt/projects/tse/eggs/Django-1.5.1-py2.7.egg', '/opt/projects/tse/eggs/zc.recipe.egg-2.0.1-py2.7.egg', '/opt/projects/tse/eggs/zc.buildout-2.2.1-py2.7.egg', '/opt/projects/tse/eggs/python_dateutil-2.2-py2.7.egg', '/opt/projects/tse/eggs/mimeparse-0.1.3-py2.7.egg', '/opt/projects/tse/eggs/sqlparse-0.1.10-py2.7.egg', '/opt/projects/tse/eggs/setuptools-2.1-py2.7.egg', '/opt/projects/tse', '/opt/projects/tse/ts', '/opt/projects/tse/ts/apps', '/opt/projects/tse/parts/django-mailer', '/opt/projects/tse/parts/django-chunks', '/opt/projects/tse/parts/django-rosetta', '/opt/projects/tse/parts/django-rosetta-grappelli', '/opt/projects/tse/parts/django-admin-enhancer', '/opt/projects/tse/parts/django-admin-enhancer/admin_enhancer', '/opt/projects/tse/parts/django-guardian', '/opt/projects/tse/parts/johnny-cache', '/opt/projects/tse/parts/django-templatesadmin', '/opt/projects/tse', '/opt/projects/tse/ts', '/usr/local/lib/python2.7/dist-packages/distribute-0.7.3-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/setuptools-2.1-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/opt/projects/tse/ts/settings', '/opt/projects/tse/ts/settings/..', '/opt/projects/tse/ts/settings/../apps', '/opt/projects/tse/ts/settings/../libs'] Server time: Mon, 12 May 2014 05:43:53 -0400 Traceback Switch to copy-and-paste view

/opt/projects/tse/eggs/Django-1.5.1-py2.7.egg/django/core/handlers/base.py in get_response response = callback(request, _callback_args, *_callback_kwargs) ... ▶ Local vars /opt/projects/tse/ts/apps/tradeschool/views.py in course_add title=barter_item_form_data['title'], ... ▶ Local vars Request information

GET

No GET data

POST

Variable Value teacher-email
u'nkechi.ebite@hubwestminster.net' item-4-title
u'Music suggestions' time-time
u'766' item-1-title
u'Jam' item-3-title
u'Snacks and drink to share!' course-max_students u'15' teacher-phone
u'' item-INITIAL_FORMS
u'0' teacher-website u'http://tradeschool.coop/Westminster/' teacher-fullname
u'Nkechi' item-5-title
u'' item-MAX_NUM_FORMS
u'1000' item-TOTAL_FORMS
u'6' course-title
u'Trade School Westminster " Mini jam"' item-0-title
u'jam pots' course-description
u'Come and "Jam" with the Trade School Westminster team, teachers and students from our Spring/ Summer season 2014! We will have short bursts of 15 min classes, such as poetry & five things to do with Jam!\r\n\r\nWe will literally be having a "mini jam" with music and munchies. Stayed tuned for more updates over the coming weeks!' csrfmiddlewaretoken u'aw4DT7qbNKX2UkuhhElKtYmBZOi1N0ib' teacher-bio u'We are the Trade School Westminster team, Nkechi, Laura, Sarah and Olivia. We are passionate about building community programmes and events, connecting the dots and love forming collaborations that take us to new and exciting places!' item-2-title
u'Offer a 15 min class on the night / Offer to teach a class for our Autumn season!' FILES

No FILES data

COOKIES

Variable Value csrftoken
'aw4DT7qbNKX2UkuhhElKtYmBZOi1N0ib' _ga 'GA1.2.1179407921.1396961956' META

Variable Value mod_wsgi.listener_port
'80' HTTP_COOKIE 'csrftoken=aw4DT7qbNKX2UkuhhElKtYmBZOi1N0ib; _ga=GA1.2.1179407921.1396961956' mod_wsgi.listener_host
'' SERVER_SOFTWARE 'Apache/2.2.22 (Ubuntu)' SCRIPT_NAME u'' mod_wsgi.handler_script '' SERVER_SIGNATURE
'

Apache/2.2.22 (Ubuntu) Server at tradeschool.coop Port 80
\n' REQUEST_METHOD
'POST' PATH_INFO
u'/westminster/page/class/add' SERVER_PROTOCOL 'HTTP/1.1' QUERY_STRING
'' CONTENT_LENGTH
'1214' HTTP_USER_AGENT 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0' HTTP_CONNECTION 'keep-alive' HTTP_REFERER
'http://tradeschool.coop/westminster/page/class/add' SERVER_NAME 'tradeschool.coop' REMOTE_ADDR '89.16.224.130' mod_wsgi.request_handler
'wsgi-script' wsgi.url_scheme 'http' PATH_TRANSLATED '/opt/projects/tse/bin/django.wsgi/westminster/page/class/add' SERVER_PORT '80' wsgi.multiprocess
False mod_wsgi.input_chunked
'0' SERVER_ADDR '107.170.26.231' DOCUMENT_ROOT
'/opt/projects/tse/ts' mod_wsgi.process_group
'tse_prod' SCRIPT_FILENAME '/opt/projects/tse/bin/django.wsgi' SERVER_ADMIN
'or@tradeschool.coop' wsgi.input
<mod_wsgi.Input object at 0x7f332e6355b0> HTTP_HOST
'tradeschool.coop' wsgi.multithread
True mod_wsgi.callable_object
'application' REQUEST_URI '/westminster/page/class/add' HTTPACCEPT 'text/html,application/xhtml+xml,application/xml;q=0.9,/_;q=0.8' wsgi.version
(1, 1) GATEWAY_INTERFACE
'CGI/1.1' wsgi.run_once
False wsgi.errors <mod_wsgi.Log object at 0x7f332e635370> REMOTE_PORT '2270' HTTP_ACCEPT_LANGUAGE
'en-gb,en;q=0.5' mod_wsgi.version
(3, 3) CONTENT_TYPE
'application/x-www-form-urlencoded' mod_wsgi.application_group
'tradeschool.coop|' mod_wsgi.script_reloading
'1' wsgi.file_wrapper
'' CSRF_COOKIE u'aw4DT7qbNKX2UkuhhElKtYmBZOi1N0ib' HTTP_ACCEPT_ENCODING
'gzip, deflate' Settings

Using settings module ts.settings.server

Setting Value LOCAL_SETTINGS
True GRAPPELLI_INDEX_DASHBOARD
'ts.dashboard.CustomIndexDashboard' USE_L10N
True USE_THOUSAND_SEPARATOR
False CSRF_COOKIE_SECURE
False LANGUAGE_CODE
'en-US' ROOT_URLCONF
'ts.urls' LOGIN_URL
'/admin' DEFAULT_CHARSET 'utf-8' STATIC_ROOT '/opt/projects/tse/ts/static/' TEMPLATESADMIN_TEMPLATE_DIRS
('/opt/projects/tse/ts/settings/../apps/branches/',) ALLOWED_HOSTS
('.tradeschool.coop',) MESSAGE_STORAGE 'django.contrib.messages.storage.fallback.FallbackStorage' EMAIL_SUBJECT_PREFIX
'[Django] ' SEND_BROKEN_LINK_EMAILS False STATICFILES_FINDERS ('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'django.contrib.staticfiles.finders.DefaultStorageFinder', 'dajaxice.finders.DajaxiceFinder') SESSION_CACHE_ALIAS 'default' SESSION_COOKIE_DOMAIN
None SESSION_COOKIE_NAME 'sessionid' ADMIN_FOR
() TIME_INPUT_FORMATS
('%H:%M:%S', '%H:%M:%S.%f', '%H:%M', '%I:%M %p') DATABASES
{'default': {'ENGINE': 'django.db.backends.mysql', 'HOST': '', 'NAME': 'tradeschoolprod', 'OPTIONS': {}, 'PASSWORD': u'***', 'PORT': '', 'TEST_CHARSET': None, 'TEST_COLLATION': None, 'TEST_MIRROR': None, 'TEST_NAME': None, 'TIME_ZONE': 'UTC', 'USER': 'tradeschooler'}} FILE_UPLOAD_PERMISSIONS None FILE_UPLOAD_HANDLERS
('django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler') DEFAULT_CONTENT_TYPE
'text/html' ROSETTA_CACHE_NAME
'rosetta' APPEND_SLASH
True FIRST_DAY_OF_WEEK
0 DATABASE_ROUTERS
[] YEAR_MONTH_FORMAT
'F Y' STATICFILES_STORAGE 'django.contrib.staticfiles.storage.StaticFilesStorage' CACHES
{'default': {'BACKEND': 'johnny.backends.memcached.MemcachedCache', 'JOHNNY_CACHE': True, 'LOCATION': ['127.0.0.1:11211']}, 'rosetta': {'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', 'LOCATION': '/var/tmp/django_cache'}} SERVER_EMAIL
'no-reply@theyoungest.webfactional.com' SESSION_COOKIE_PATH '/' MIDDLEWARE_CLASSES
('johnny.middleware.LocalStoreClearMiddleware', 'johnny.middleware.QueryCacheMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'tradeschool.middleware.BranchMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.redirects.middleware.RedirectFallbackMiddleware', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware') USE_I18N
True THOUSAND_SEPARATOR
',' SECRETKEY
u'**
****_' LANGUAGE_COOKIE_NAME
'django_language' FILE_UPLOAD_TEMP_DIR
None TEMPLATESADMIN_EDITHOOKS
('templatesadmin.edithooks.dotbackupfiles.DotBackupFilesHook', 'tradeschool.edithooks.CollectStaticFilesHook') TRANSACTIONS_MANAGED
False LOGGING_CONFIG
'django.utils.log.dictConfig' TEMPLATE_LOADERS
('django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader') WSGI_APPLICATION
None TEMPLATE_DEBUG
True X_FRAME_OPTIONS 'SAMEORIGIN' AUTHENTICATION_BACKENDS ('django.contrib.auth.backends.ModelBackend',) FORCE_SCRIPT_NAME
None USE_X_FORWARDED_HOST
False SIGNING_BACKEND 'django.core.signing.TimestampSigner' SESSION_COOKIE_SECURE
False GOOGLE_ANALYTICSKEY
u'**
****_' FILE_CHARSET
'utf-8' DEBUG
True SESSION_FILE_PATH
None DEFAULT_FILE_STORAGE
'django.core.files.storage.FileSystemStorage' INSTALLED_APPS
('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'grappelli.dashboard', 'grappelli', 'rosetta-grappelli', 'django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.humanize', 'django.contrib.redirects', 'django.contrib.flatpages', 'flatpages_tinymce', 'django_ace', 'templatesadmin', 'south', 'pytz', 'dajaxice', 'rosetta', 'admin_enhancer', 'tradeschool', 'migration') LANGUAGES_BIDI
('he', 'ar', 'fa') COMMENTS_ALLOW_PROFANITIES
False STATICFILES_DIRS
('/opt/projects/tse/ts/settings/../apps/branches', '/opt/projects/tse/ts/settings/../../parts/django-admin-enhancer/admin_enhancer/static') PREPEND_WWW False SECURE_PROXY_SSL_HEADER None GRAPPELLI_ADMIN_TITLE
<django.utils.functional.proxy object at 0x7f332c687fd0> SESSION_COOKIE_HTTPONLY True DEBUG_PROPAGATE_EXCEPTIONS
False CSRF_COOKIE_DOMAIN
None MONTH_DAY_FORMAT
'F j' MANAGERS
(('Or Zubalsky', 'juviley@gmail.com'),) SESSION_EXPIRE_AT_BROWSER_CLOSE False TIME_FORMAT 'P' TEMPLATESADMIN_GROUP
'translators' AUTH_USER_MODEL 'tradeschool.Person' DATE_INPUT_FORMATS
('%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%b %d %Y', '%b %d, %Y', '%d %b %Y', '%d %b, %Y', '%B %d %Y', '%B %d, %Y', '%d %B %Y', '%d %B, %Y') CSRF_COOKIE_NAME
'csrftoken' EMAIL_HOSTPASSWORD u'******_' ROSETTA_WSGI_AUTO_RELOAD
True STAGE_NAME
'DEV' PASSWORD_RESET_TIMEOUTDAYS u'******_' CACHE_MIDDLEWARE_ALIAS
'default' SESSION_SAVE_EVERY_REQUEST
False ADMIN_MEDIA_PREFIX
'/admin/media/' NUMBER_GROUPING 0 SESSION_ENGINE
'django.contrib.sessions.backends.db' CSRF_FAILURE_VIEW
'django.views.csrf.csrf_failure' CSRF_COOKIE_PATH
'/' ROSETTA_MESSAGES_PER_PAGE
100 LOGIN_REDIRECT_URL
'/accounts/profile/' DECIMAL_SEPARATOR
'.' IGNORABLE_404_URLS
() LOCALE_PATHS
('/opt/projects/tse/ts/settings/../apps/tradeschool/locale/',) JOHNNY_MIDDLEWARE_KEYPREFIX
u'**
****_' TEMPLATE_STRING_IF_INVALID
'' BASE_BRANCH_TEMPLATE_DIR
'/opt/projects/tse/ts/settings/../apps/tradeschool/templates/branches_base' LOGOUT_URL
'/accounts/logout/' EMAIL_USE_TLS
False FIXTURE_DIRS
('/opt/projects/tse/ts/settings/../apps/tradeschool/fixtures',) EMAIL_HOST
'smtp.webfaction.com' DATE_FORMAT 'N j, Y' MEDIA_ROOT
'/opt/projects/tse/ts/media/' DEFAULT_EXCEPTION_REPORTER_FILTER
'django.views.debug.SafeExceptionReporterFilter' ADMINS
(('Or Zubalsky', 'juviley@gmail.com'),) FORMAT_MODULE_PATH
None DEFAULT_FROM_EMAIL
'mail@tradeschool.coop' MEDIA_URL
'http://tradeschool.coop/media/' DATETIME_FORMAT 'N j, Y, P' TEMPLATE_DIRS
('/opt/projects/tse/ts/settings/../apps/branches/', '/opt/projects/tse/ts/settings/../apps/tradeschool/templates/branches_default', '/opt/projects/tse/ts/settings/../apps/tradeschool/templates/branches_base', '/opt/projects/tse/ts/settings/../apps/tradeschool/templates', '/opt/projects/tse/ts/settings/../templates', '/opt/projects/tse/ts/settings/../../parts/django-admin-enhancer/admin_enhancer/templates/') SITE_ID 1 DISALLOWED_USER_AGENTS
() ALLOWED_INCLUDE_ROOTS
() LOGGING {'disable_existing_loggers': False, 'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}}, 'handlers': {'console': {'class': 'logging.StreamHandler', 'level': 'DEBUG'}, 'mail_admins': {'class': 'django.utils.log.AdminEmailHandler', 'filters': ['require_debug_false'], 'level': 'ERROR'}}, 'loggers': {'dajaxice': {'handlers': ['console'], 'level': 'ERROR', 'propagate': True}, 'django.request': {'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': True}}, 'version': 1} PROJECT_DIR '/opt/projects/tse/ts/settings/..' TEST_RUNNER 'django.test.simple.DjangoTestSuiteRunner' SHORT_DATE_FORMAT
'm/d/Y' CACHE_MIDDLEWARE_KEYPREFIX u'******_' TIME_ZONE
'America/New_York' FILE_UPLOAD_MAX_MEMORY_SIZE 2621440 EMAIL_BACKEND
'django.core.mail.backends.smtp.EmailBackend' DEFAULT_TABLESPACE
'' TEMPLATE_CONTEXT_PROCESSORS ('django.contrib.auth.context_processors.auth', 'django.core.context_processors.request', 'django.core.context_processors.i18n', 'django.core.context_processors.debug', 'django.core.context_processors.media', 'django.core.context_processors.static', 'django.core.context_processors.tz', 'django.contrib.messages.context_processors.messages', 'tradeschool.context_processors.branch', 'tradeschool.context_processors.google_analytics') SESSION_COOKIE_AGE
1209600 SETTINGS_MODULE 'ts.settings.server' BRANCH_TEMPLATE_DIR '/opt/projects/tse/ts/settings/../apps/branches/' USE_ETAGS
False LANGUAGES
(('en', 'English'), ('es-ES', 'Spanish (Spain)'), ('es-MX', 'Spanish (Mexico)'), ('es-US', 'Spanish (US)'), ('es-AR', 'Spanish (Argentina)'), ('es-CL', 'Spanish (Chile)'), ('es-EC', 'Spanish (Ecuador)'), ('es-PR', 'Spanish (Puerto Rico)'), ('es-VE', 'Spanish (Venezuela)'), ('de-DE', 'German'), ('ms-SG', 'Malay'), ('zh-SG', 'Chinese (Singapore)'), ('it-IT', 'Italian'), ('tl', 'Tagalog'), ('fr', 'French'), ('nl-NL', 'Dutch'), ('th', 'Thai'), ('pt-BR', 'Portuguese'), ('el-GR', 'Greek'), ('ru-RU', 'Russian'), ('zh-CN', 'Chinese (China)'), ('vi', 'Vietnamese'), ('ta-SG', 'Tamil (Singapore)')) DEFAULT_INDEX_TABLESPACE
'' INTERNAL_IPS
('127.0.0.1',) STATIC_URL
'http://tradeschool.coop/static/' EMAIL_PORT
25 USE_TZ
True SHORT_DATETIME_FORMAT
'm/d/Y P' PASSWORDHASHERS
u'**
****_' TINYMCE_DEFAULT_CONFIG
{'plugins': 'table,spellchecker,paste,searchreplace', 'theme': 'advanced'} ABSOLUTE_URL_OVERRIDES
{} CACHE_MIDDLEWARE_SECONDS
600 DATETIME_INPUT_FORMATS
('%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M:%S.%f', '%Y-%m-%d %H:%M', '%Y-%m-%d %I:%M %p', '%Y-%m-%d', '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M:%S.%f', '%m/%d/%Y %H:%M', '%m/%d/%Y', '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M:%S.%f', '%m/%d/%y %H:%M', '%m/%d/%y') DEFAULT_BRANCH_TEMPLATE_DIR '/opt/projects/tse/ts/settings/../apps/tradeschool/templates/branches_default' ROSETTA_STORAGE_CLASS
'rosetta.storage.CacheRosettaStorage' EMAIL_HOST_USER 'theyoungest' PROFANITIESLIST
u'**
*****' You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 500 page.