Shalitha Suranga wants to merge 4 commits from /u/shalithasuranga/allura/ to master, 2018-10-04
[52357c] (redirectfix) by Shalitha
[#8225] Fix skip 404 by validatiing request.referer
[38666c] by Shalitha Suranga
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/allura into redirectfix
[a25e33] by Shalitha Suranga
[#8225] Redirect if current object is deleted
Log in to post a comment.
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?
Last edit: Shalitha Suranga 2018-10-02
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_mountsto 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?
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.pyor for a single class or method like:
allura.tests.functional.test_admin:TestProjectAdmin.test_admin_controllertest 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.
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