louking / rrwebapp

Race Results Web Application
0 stars 1 forks source link

BuildError exception in EditParticipants view #521

Open louking opened 3 years ago

louking commented 3 years ago
Message type:       ERROR
Location:           /var/www/scoretility.com/venv/lib64/python3.6/site-packages/flask/app.py:1892
Module:             app
Function:           log_exception
Time:               2021-09-30 15:03:58,972
User:               [claire]

Message:

Exception on /admin/editparticipants/46839 [GET]

Traceback (most recent call last):
  File "/var/www/scoretility.com/venv/lib64/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/www/scoretility.com/venv/lib64/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/www/scoretility.com/venv/lib64/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/var/www/scoretility.com/venv/lib64/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/var/www/scoretility.com/venv/lib64/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/www/scoretility.com/venv/lib64/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/var/www/scoretility.com/venv/lib64/python3.6/site-packages/flask_login/utils.py", line 272, in decorated_view
    return func(*args, **kwargs)
  File "/var/www/scoretility.com/venv/lib64/python3.6/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/var/www/scoretility.com/venv/lib64/python3.6/site-packages/flask/views.py", line 163, in dispatch_request
    return meth(*args, **kwargs)
  File "/var/www/scoretility.com/rrwebapp/rrwebapp/views/admin/results.py", line 166, in get
    return flask.redirect(url_for('manageraces'))
  File "/var/www/scoretility.com/venv/lib64/python3.6/site-packages/flask/helpers.py", line 370, in url_for
    return appctx.app.handle_url_build_error(error, endpoint, values)
  File "/var/www/scoretility.com/venv/lib64/python3.6/site-packages/flask/app.py", line 2216, in handle_url_build_error
    reraise(exc_type, exc_value, tb)
  File "/var/www/scoretility.com/venv/lib64/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/var/www/scoretility.com/venv/lib64/python3.6/site-packages/flask/helpers.py", line 358, in url_for
    endpoint, values, method=method, force_external=external
  File "/var/www/scoretility.com/venv/lib64/python3.6/site-packages/werkzeug/routing.py", line 2179, in build
    raise BuildError(endpoint, values, method, self)
werkzeug.routing.BuildError: Could not build url for endpoint 'manageraces'. Did you mean 'admin.manageraces' instead?
louking commented 3 weeks ago

From Mike:

That's the result of me adding a Race without remembering to select any Series that the race might be in. scoretility will add the Race, and let me select the Race, but when I try to use Edit Participants to add a team member's result to the Race, that's when it throws the exception. I've done that enough times that I remember what I did wrong and correct it. I do that by editing the Race and adding All Races and Other Races or whatever series I forgot. I think you could head off the exception by populating the series field of the Races screen with All Races, which would remind me not to forget the series field altogether. I tend to do that when I've been adding race results for longer than my attention span lasts.

Similar to the following

Message type:       ERROR
Location:           /var/www/[scoretility.com/venv/lib/python3.9/site-packages/flask/app.py:1741](http://scoretility.com/venv/lib/python3.9/site-packages/flask/app.py:1741)
Module:             app
Function:           log_exception
Time:               2024-11-10 11:05:34,991
User:               [Mike K]

Message:

Exception on /admin/editparticipants/61608 [GET]

Traceback (most recent call last):
  File "/var/www/[scoretility.com/venv/lib/python3.9/site-packages/flask/app.py](http://scoretility.com/venv/lib/python3.9/site-packages/flask/app.py)", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/www/[scoretility.com/venv/lib/python3.9/site-packages/flask/app.py](http://scoretility.com/venv/lib/python3.9/site-packages/flask/app.py)", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/www/[scoretility.com/venv/lib/python3.9/site-packages/flask/app.py](http://scoretility.com/venv/lib/python3.9/site-packages/flask/app.py)", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/www/[scoretility.com/venv/lib/python3.9/site-packages/flask/app.py](http://scoretility.com/venv/lib/python3.9/site-packages/flask/app.py)", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/var/www/[scoretility.com/venv/lib/python3.9/site-packages/flask_login/utils.py](http://scoretility.com/venv/lib/python3.9/site-packages/flask_login/utils.py)", line 290, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
  File "/var/www/[scoretility.com/venv/lib/python3.9/site-packages/flask/views.py](http://scoretility.com/venv/lib/python3.9/site-packages/flask/views.py)", line 107, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)
  File "/var/www/[scoretility.com/venv/lib/python3.9/site-packages/flask/views.py](http://scoretility.com/venv/lib/python3.9/site-packages/flask/views.py)", line 188, in dispatch_request
    return current_app.ensure_sync(meth)(**kwargs)
  File "/var/www/[scoretility.com/rrwebapp/rrwebapp/views/admin/results.py](http://scoretility.com/rrwebapp/rrwebapp/views/admin/results.py)", line 166, in get
    return flask.redirect(url_for('manageraces'))
  File "/var/www/[scoretility.com/venv/lib/python3.9/site-packages/flask/helpers.py](http://scoretility.com/venv/lib/python3.9/site-packages/flask/helpers.py)", line 256, in url_for
    return current_app.url_for(
  File "/var/www/[scoretility.com/venv/lib/python3.9/site-packages/flask/app.py](http://scoretility.com/venv/lib/python3.9/site-packages/flask/app.py)", line 2031, in url_for
    return self.handle_url_build_error(error, endpoint, values)
  File "/var/www/[scoretility.com/venv/lib/python3.9/site-packages/flask/app.py](http://scoretility.com/venv/lib/python3.9/site-packages/flask/app.py)", line 2020, in url_for
    rv = url_adapter.build(  # type: ignore[union-attr]
  File "/var/www/[scoretility.com/venv/lib/python3.9/site-packages/werkzeug/routing/map.py](http://scoretility.com/venv/lib/python3.9/site-packages/werkzeug/routing/map.py)", line 917, in build
    raise BuildError(endpoint, values, method, self)
werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'manageraces'. Did you mean 'admin.manageraces' instead?
louking commented 3 weeks ago

from Mike:

Yeah, I haven't added results to scoretility for over a year, but when I saw the error I immediately remembered what I did wrong. It's because I jump back and forth, cutting and pasting between the results notification email and scoretility to create the Race and then add the result. I cut and paste the race name, figure out the distance and race surface, and cut the racer's time, and save the Race without remembering to select the series name because I'm focused on pasting in the runner's time. I just get ahead of myself.

Going back some years, there was a time when it was seemingly impossible for me to find a Race in scoretility to delete it if I had added it without any series selected. You fixed it so the Race appears in a search, so now it's an easy process to find and Edit the Race and add the correct Series names.

For now, maybe a Hint could be added to the User's Guide. Something like: "If you receive an Exception error message when adding a runner's result to a Race entry, check to see that the Race entry has the correct Series values specified."