wants to merge 4 commits
[#8225] Fix skip 404 by validatiing request.referer
[#8225] Skip 404 for non root and only when deleted
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/allura into redirectfix
[#8225] Redirect if current object is deleted
This fix skips 404 error when user at mount point exactly means that when user clicks "Delete Everything" on module which is going to be deleted.. when user delete from http://localhost:8080/p/allura/blog2/new it will display 404 but not delete from http://localhost:8080/p/allura/blog2/
Do we need to skip 404 from urls like http://localhost:8080/p/allura/blog2/new too?
Yes I think it would be good to avoid the 404 page for any path within a tool that is deleted.
A few tests in the Allura and ForgeLink packages fail with this change. It looks like those tests and other code paths use update_mounts to install tools too, so that should be kept in mind - seems to function fine when I install a tool though.
Added fix to redirect root only when delete and regex mached with probject/mountpoint also
Btw. Can you advice how you run unit tests for selected module only ? Are you using python -m unittest discover ?
python -m unittest discover
https://forge-allura.apache.org/docs/development/contributing.html#testing has some notes about testing. It doesn't mention it but you can also run tests for a single file like: nosetests path/to/file.py or for a single class or method like: nosetests some.package:TestClass.test_foo
The allura.tests.functional.test_admin:TestProjectAdmin.test_admin_controller test fails for me still. I think its because referrer can be None in tests. We do request.referer or ' in some places to avoid problems like this one.
request.referer or '
Thanks nosetests is good option for running only selected case. I did some fix and now no issues with above test. For all future fixes I will run nosetests before committing
Log in to post a comment.