Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registration is a mess #55

Open
franciscoabenza opened this issue Nov 6, 2022 · 6 comments
Open

Registration is a mess #55

franciscoabenza opened this issue Nov 6, 2022 · 6 comments

Comments

@franciscoabenza
Copy link
Contributor

No description provided.

@zeyus
Copy link
Member

zeyus commented Nov 7, 2022

@franciscoabenza can we get some more details? e.g. what's broken, how it should work correctly (or a suggestion of what to fix) :)

@emilroenn
Copy link
Contributor

At least on my try:

BuildError
werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'login'. Did you mean 'user_controller.login' instead?

Traceback (most recent call last)
File "C:\Users\emilr\Anaconda3\envs\nlp4all\lib\site-packages\flask\app.py", line 2548, in call
return self.wsgi_app(environ, start_response)
File "C:\Users\emilr\Anaconda3\envs\nlp4all\lib\site-packages\flask\app.py", line 2528, in wsgi_app
response = self.handle_exception(e)
File "C:\Users\emilr\Anaconda3\envs\nlp4all\lib\site-packages\flask_cors\extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "C:\Users\emilr\Anaconda3\envs\nlp4all\lib\site-packages\flask\app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\emilr\Anaconda3\envs\nlp4all\lib\site-packages\flask\app.py", line 1822, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\emilr\Anaconda3\envs\nlp4all\lib\site-packages\flask_cors\extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "C:\Users\emilr\Anaconda3\envs\nlp4all\lib\site-packages\flask\app.py", line 1820, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\emilr\Anaconda3\envs\nlp4all\lib\site-packages\flask\app.py", line 1796, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "c:\Users\emilr\OneDrive - Aarhus universitet\Uni\NLP4ALL\nlp4all\nlp4all\controllers\UserController.py", line 114, in register
return redirect(url_for("login"))
File "C:\Users\emilr\Anaconda3\envs\nlp4all\lib\site-packages\flask\helpers.py", line 256, in url_for
return current_app.url_for(
File "C:\Users\emilr\Anaconda3\envs\nlp4all\lib\site-packages\flask\app.py", line 2031, in url_for
return self.handle_url_build_error(error, endpoint, values)
File "C:\Users\emilr\Anaconda3\envs\nlp4all\lib\site-packages\flask\app.py", line 2020, in url_for
rv = url_adapter.build( # type: ignore[union-attr]
File "C:\Users\emilr\Anaconda3\envs\nlp4all\lib\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 'login'. Did you mean 'user_controller.login' instead?

@franciscoabenza
Copy link
Contributor Author

Hey guys I left it yesterday half way done. The target 🎯:
Screenshot 2022-11-07 at 12 23 49

including the backend for it. give me feedback @zeyus @emilroenn

@franciscoabenza
Copy link
Contributor Author

@arthurhjorth, is there any reason why it was designed from the beginning with username? We thought that in a class enviorment it would be useful for the teacher to know the students by name. Tell me what you think :)

@arthurhjorth
Copy link
Contributor

Hah, yes there is a reason but it's not a good one. Creating the user registration forms, User db model, and sign up process was the first thing I ever did in Flask and I was following a tutorial without really thinking about it because I didn't totally understand what I was doing. I definitely agree it would be more useful with the actual name, and feel free to change.

@arthurhjorth
Copy link
Contributor

That said, I haven't seen that error before. I've definitely had people sign up in the past few months, so not sure what happened there. Don't know if somehow the @app.route decorator got deleted somehow. But if you change it all anyway, it shouldn't matter.

@franciscoabenza franciscoabenza linked a pull request Nov 7, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants