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

Path rule for /template not forwarding to category #188

Closed
fluffy-critter opened this issue Apr 3, 2019 · 1 comment

Comments

@fluffy-critter
Copy link
Collaborator

commented Apr 3, 2019

Expected Behavior

A URL like http://example.com/foo should redirect to http://example.com/foo/ if foo is a category and not a template

Current Behavior

http://example.com/photos returns a 404 with an error like:

path: /photos
full_path: /photos?
endpoint: category
url_rule: /<template>
Exception information: NotFound: No such view

for example: https://mullinslab.microbiol.washington.edu/photos

@fluffy-critter fluffy-critter added the bug label Apr 3, 2019

@fluffy-critter

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 3, 2019

This seems to be a regression; there is code to handle this already, on rendering.py:239 (in render_category):

    if not tmpl:
        # this might actually be a malformed category URL
        test_path = '/'.join((category, template))
        record = orm.select(
            e for e in model.Entry if e.category == test_path).exists()
        if record:
            return redirect(url_for('category', category=test_path, **request.args))

        # nope, we just don't know what this is
        raise http_error.NotFound("No such view")

@fluffy-critter fluffy-critter added this to the 0.4 milestone Apr 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.