Closed seeeturtle closed 6 years ago
Hey @seeeturtle,
That was quick! But with this PR you handle the following route: /<username>
. However, according to the issue, we want to return results for the following route /?username=<username>
.
For this you need to make changes at: https://github.com/manu-chroma/username-availability-checker/blob/master/frontend.py#L11. Also, have a look at http://flask.pocoo.org/docs/0.12/quickstart/#routing
From the above link:
To access parameters submitted in the URL (?key=value) you can use the args attribute:
searchword = request.args.get('key', '')```
Since checking for username is the special condition,
Can you do if username
rather than if not username
?
I'm pointing out these things just because you can learn from this. I will merge as soon as you make that change!
^ Now that you've understood the issue and how to fix it, you might want to change commit message to something like: frontend.py: Support username query in GET method
? (Since, GET method for that route was already present in the code.)
This GET method returns rendered status.html. This method requires username as variable.
Closes https://github.com/manu-chroma/username-availability-checker/issues/22