为什么会出现错误:
具有相同键的项目已经添加。
在ssrs中获取代码:
Traceback (most recent call last):
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\app.py", line 1997, in __call__
return self.wsgi_app(environ, start_response)
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\app.py", line 1985, in wsgi_app
response = self.handle_exception(e)
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\app.py", line 1540, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\_compat.py", line 33, in reraise
raise value
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\_compat.py", line 33, in reraise
raise value
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "C:\Users\snguyen\Documents\Nevco_Support\nevco-support\nevco_support\main\views.py", line 151, in register
form=form, form_success=False)
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\templating.py", line 134, in render_template
context, ctx.app)
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\templating.py", line 116, in _render
rv = template.render(context)
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\jinja2\asyncsupport.py", line 76, in render
return original_render(self, *args, **kwargs)
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\jinja2\environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\jinja2\environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\jinja2\_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "C:\Users\snguyen\Documents\Nevco_Support\nevco-support\nevco_support\templates\main\register.html", line 2, in top-level template code
{% from 'content/helpers.html' import render_field %}
File "C:\Users\snguyen\Documents\Nevco_Support\nevco-support\nevco_support\templates\layout.html", line 36, in top-level template code
{% block body %}
File "C:\Users\snguyen\Documents\Nevco_Support\nevco-support\nevco_support\templates\layout.html", line 81, in block "body"
{% block js %}
File "C:\Users\snguyen\Documents\Nevco_Support\nevco-support\nevco_support\templates\main\register.html", line 848, in block "js"
if ({{ media_types|tojson }}.indexOf(mediaType) != -1) {
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\json.py", line 269, in tojson_filter
return Markup(htmlsafe_dumps(obj, **kwargs))
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\json.py", line 183, in htmlsafe_dumps
rv = dumps(obj, **kwargs) \
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\json.py", line 123, in dumps
rv = _json.dumps(obj, **kwargs)
File "C:\Users\snguyen\AppData\Local\Programs\Python\Python36-32\lib\json\__init__.py", line 238, in dumps
**kw).encode(obj)
File "C:\Users\snguyen\AppData\Local\Programs\Python\Python36-32\lib\json\encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "C:\Users\snguyen\AppData\Local\Programs\Python\Python36-32\lib\json\encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "C:\Users\snguyen\Documents\Nevco_Support\venv\lib\site-packages\flask\json.py", line 80, in default
return _json.JSONEncoder.default(self, o)
File "C:\Users\snguyen\AppData\Local\Programs\Python\Python36-32\lib\json\encoder.py", line 180, in default
o.__class__.__name__)
TypeError: Object of type 'Undefined' is not JSON serializable