flask-classy icon indicating copy to clipboard operation
flask-classy copied to clipboard

urls resolving to the wrong methods

Open bdeggleston opened this issue 11 years ago • 2 comments

if I define two classes and methods with the same class names and method names, but are in different files with different urls in the route decorator, requests for one method will be erroneously routed to the wrong class

#app.module1
class SomeView(FlaskView):

    @route('/some/view')
    def do_something_cool(self):
        return response.success('123')
#app.module2
class SomeView(FlaskView):

    @route('/some/other/view')
    def do_something_cool(self):
        return response.success('456')

If I hit the url /some/view, it will call the route /some/other/route

bdeggleston avatar Feb 28 '13 01:02 bdeggleston

Interesting. I presume that the endpoints used by url_for will be similarly corrupted. I'll write a test case up and see if I can't get a fix out for this.

apiguy avatar Feb 28 '13 06:02 apiguy

Is this issue is resolved?

Sohair63 avatar Oct 02 '14 11:10 Sohair63