inducer / relate

RELATE is an Environment for Learning And TEaching
http://documen.tician.de/relate
Other
383 stars 119 forks source link

KeyError at /course/relate-sample/grant-exception/171/exam-1/3516/ #25

Closed dzhuang closed 9 years ago

dzhuang commented 9 years ago

'set_access_rules_tag'

Request Method: POST
Request URL:    http://127.0.0.1:8000/course/relate-sample/grant-exception/171/exam-1/3516/
Django Version: 1.8.1
Exception Type: KeyError
Exception Value:    
'set_access_rules_tag'
Exception Location: E:\git-trial\course\relate\course\views.py in grant_exception_stage_3, line 786
Python Executable:  d:\Python27\python.exe
Python Version: 2.7.9

git SHA: 316742d64b32cda3e5a752545877e509e986d5b2

Environment:

Request Method: POST
Request URL: http://127.0.0.1:8000/course/relate-sample/grant-exception/171/exam-1/3516/

Django Version: 1.8.1
Python Version: 2.7.9
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'course',
 'crispy_forms',
 'jsonfield',
 'bootstrap3_datetime',
 'djangobower')
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',
 'course.auth.ImpersonateMiddleware')

Traceback:
File "d:\Python27\lib\site-packages\django\core\handlers\base.py" in get_response
  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "E:\git-trial\course\relate\course\utils.py" in wrapper
  434.         return f(pctx, *args, **kwargs)
File "d:\Python27\lib\site-packages\django\utils\decorators.py" in inner
  145.                     return func(*args, **kwargs)
File "E:\git-trial\course\relate\course\views.py" in grant_exception_stage_3
  786.             new_access_rules_tag = form.cleaned_data["set_access_rules_tag"]

Exception Type: KeyError at /course/relate-sample/grant-exception/171/exam-1/3516/
Exception Value: 'set_access_rules_tag'
dzhuang commented 9 years ago

The errors seems to be the dict form.cleaned_data doesn't have a key named set_access_rules_tag while it is visited.

BTW, I am wondering where to set the tags for access rules, manually? . I can only use <<<NONE>>>, while it seem there can be more options.

dzhuang commented 9 years ago

Thank you :)

dzhuang commented 9 years ago

It works like a charm. Thanks again!