/u/ is the Users neighborhood which is created automatically and contains the personal projects for everyone. The wiki is a neighborhood-level tool which is installed by default and uses the [[projects show_total=yes]] macro. That macro is a general one that works in any neighborhood and lists all the projects in the neighborhood.
So I guess we would need some logic in that macro to check if it is a user-project and if the user is pending. Or probably better: not create the user-project at all when a user is just pending. Create it after they are activated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The user-project is created automatically. E.g. the /u/pranav/ project was created for you when you created your account. I think we need to find where that is happening and do it later in the process, so it only is created when the account is activated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
if auth.require_email_addr = false in the settings, then a user project never gets created. You can probably fix it with something like: make_project=(not require_email)
There are a few minor pep8 violations.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey Pranav -- nice work. This appears to work well.
The pep8 issues are minor -- but there are a few tools to make checking for violations.
I recommend setting up your editor to display pep8 issues in real time -- but you can also use flake8 (which supports git diffs).
for example:
git diff origin/master | flake8 --diff
gives the following output:
./Allura/allura/controllers/auth.py:238:40: E231 missing whitespace after ','
./Allura/allura/controllers/auth.py:239:120: E501 line too long (144 > 119 characters)
./Allura/allura/controllers/auth.py:275:47: E711 comparison to None should be 'if cond is None:'
./Allura/allura/controllers/auth.py:282:32: E128 continuation line under-indented for visual indent
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There are two assertions currently in test_create_account_require_email.
After each assertion, we could just put a simple check confirming the existence of a 'user' project.
deftest_create_account_require_email(self):#...assertnotuser.pendingassert_equal(M.Project.query.find({'name':'u/aaa'}).count(),1)#...assertuser.pending# Pending users should not have a user projectassert_equal(M.Project.query.find({'name':'u/bbb'}).count(),0)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We're using nose for testing in Allura. Nose allows for a mixture of assertion styles. You can use the built-in python assert, or any one of the functions from nose.tools (such as assert_equals). The main advantage that something like assert_equals has over a standard assertion is that it results in a more readable error message when a failure occurs.
As to why it didn’t work when you tried it -- I’m not sure. Did you have any error messages?
This should work:
What is the wiki for ? '/u/wiki/home' is project wiki or what? And which users are currently shown there?
/u/
is the Users neighborhood which is created automatically and contains the personal projects for everyone. The wiki is a neighborhood-level tool which is installed by default and uses the[[projects show_total=yes]]
macro. That macro is a general one that works in any neighborhood and lists all the projects in the neighborhood.So I guess we would need some logic in that macro to check if it is a user-project and if the user is pending. Or probably better: not create the user-project at all when a user is just pending. Create it after they are activated.
Would taking away the permission of creating projects from a non-verified user would be enough?
The user-project is created automatically. E.g. the /u/pranav/ project was created for you when you created your account. I think we need to find where that is happening and do it later in the process, so it only is created when the account is activated.
Hey Pranav -- your merge request is looking good.
There is just a couple of things:
auth.require_email_addr = false
in the settings, then a user project never gets created. You can probably fix it with something like:make_project=(not require_email)
Does this look fine?
https://forge-allura.apache.org/u/pranav/allura/ci/287df23eba86a8e1992b2a92b3a7a5d899f8b7aa/
Also, what are the pep8 violations you are refering about?
Hey Pranav -- nice work. This appears to work well.
The pep8 issues are minor -- but there are a few tools to make checking for violations.
I recommend setting up your editor to display pep8 issues in real time -- but you can also use flake8 (which supports git diffs).
for example:
git diff origin/master | flake8 --diff
gives the following output:
./Allura/allura/controllers/auth.py:238:40: E231 missing whitespace after ','
./Allura/allura/controllers/auth.py:239:120: E501 line too long (144 > 119 characters)
./Allura/allura/controllers/auth.py:275:47: E711 comparison to None should be 'if cond is None:'
./Allura/allura/controllers/auth.py:282:32: E128 continuation line under-indented for visual indent
https://forge-allura.apache.org/p/allura/git/merge-requests/61/
Nice work man :)
Could you also add an assertion (or two) in tests.functional.test_auth.TestAuth#test_create_account_require_email?
I should have mentioned that in a previous comment -- sorry about that.
What should the functional tests confirm exactly?
There are two assertions currently in test_create_account_require_email.
After each assertion, we could just put a simple check confirming the existence of a 'user' project.
https://forge-allura.apache.org/u/pranav/allura/ci/8530054c9b3716e186ec290bc9334f96c5a612e5/
Thanks. Also, where could I learn more about the assertions (basically syntax). Also, which modifications really need assertions?
I also tried this -
at right places.
but it failed. Why? Do you use TDD approach to code?
Last edit: Pranav Sharma 2015-12-16
Hey Pranav -- good idea using private_project().
Try something like:
We're using nose for testing in Allura. Nose allows for a mixture of assertion styles. You can use the built-in python assert, or any one of the functions from nose.tools (such as assert_equals). The main advantage that something like assert_equals has over a standard assertion is that it results in a more readable error message when a failure occurs.
As to why it didn’t work when you tried it -- I’m not sure. Did you have any error messages?
This should work:
If you want to checkout some of the other built-in nose assertions:
This looks good though Pranav -- I merged from pr/8013.
Nice work :)