vj4 icon indicating copy to clipboard operation
vj4 copied to clipboard

Deleting a problem in a contest causes 500

Open iceboy233 opened this issue 6 years ago • 1 comments

E Error handling request
Traceback (most recent call last):
  File "/home/vj4/.local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 406, in start
    resp = await task
  File "/home/vj4/.local/lib/python3.6/site-packages/aiohttp/web_app.py", line 435, in _handle
    resp = await handler(request)
  File "/home/vj4/git/vj4/vj4/handler/base.py", line 228, in __await__
    yield from super(Handler, self).__await__()
  File "/home/vj4/.local/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py", line 870, in _iter
    resp = await method()
  File "/home/vj4/git/vj4/vj4/handler/contest.py", line 185, in get
    page_title=tdoc['title'], path_components=path_components)
  File "/home/vj4/git/vj4/vj4/handler/base.py", line 255, in render
    self.response.text = self.render_html(template_name, **kwargs)
  File "/home/vj4/git/vj4/vj4/handler/base.py", line 204, in render_html
    return template.Environment().get_template(template_name).render(kwargs)
  File "/home/vj4/.local/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "/home/vj4/.local/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/home/vj4/.local/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/vj4/.local/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/home/vj4/git/vj4/vj4/ui/templates/contest_detail.html", line 4, in top-level template code
    {% import "components/problem.html" as problem with context %}
  File "/home/vj4/git/vj4/vj4/ui/templates/layout/basic.html", line 2, in top-level template code
    {% extends "layout/html5.html" %}
  File "/home/vj4/git/vj4/vj4/ui/templates/layout/html5.html", line 36, in top-level template code
    {% block body %}{% endblock %}
  File "/home/vj4/git/vj4/vj4/ui/templates/layout/basic.html", line 12, in block "body"
    {% block content %}{% endblock %}
  File "/home/vj4/git/vj4/vj4/ui/templates/contest_detail.html", line 62, in block "content"
    {{ problem.render_problem_title(pdict[pid], tdoc=tdoc, show_invisible_flag=false, show_tags=false) }}
  File "/home/vj4/.local/lib/python3.6/site-packages/jinja2/runtime.py", line 579, in _invoke
    rv = self._func(*arguments)
  File "/home/vj4/git/vj4/vj4/ui/templates/components/problem.html", line 7, in template
    href="{{ reverse_url('contest_detail_problem', domain_id=pdoc['domain_id'], pid=pdoc['doc_id'], tid=tdoc['doc_id']) }}"
  File "/home/vj4/git/vj4/vj4/handler/base.py", line 371, in _reverse_url
    return str(app.Application().router[name].url_for(**kwargs))
  File "/home/vj4/.local/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py", line 442, in url_for
    for k, v in parts.items()})
  File "/home/vj4/.local/lib/python3.6/site-packages/aiohttp/web_urldispatcher.py", line 442, in <dictcomp>
    for k, v in parts.items()})
  File "/home/vj4/.local/lib/python3.6/site-packages/yarl/__init__.py", line 213, in build
    path = cls._PATH_QUOTER(path)
  File "yarl/_quoting.pyx", line 226, in yarl._quoting._Quoter.__call__
TypeError: Argument should be str

iceboy233 avatar Jan 01 '19 09:01 iceboy233

This is caused by some of the problems in a contest being deleted.

Example: https://vijos.org/contest/51122cdc4e4112641200009c

iceboy233 avatar Jan 02 '19 01:01 iceboy233