-
Notifications
You must be signed in to change notification settings - Fork 49
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
Restricted accounts #788
Restricted accounts #788
Conversation
would this be interesting for a feature like this? |
Öh, the part with |
d8dbae1
to
6cc0dbd
Compare
Ok, flattened the if/else blocks, but I kept some of the |
987d094
to
5e4e348
Compare
PROJECT_CREATE_RESTRICTED and PROJECT_CREATE_GROUPS to settings
5e4e348
to
389680b
Compare
@@ -183,7 +183,7 @@ rest_framework = ["rest_framework"] | |||
[tool.pytest.ini_options] | |||
DJANGO_SETTINGS_MODULE = "config.settings" | |||
testpaths = ["rdmo"] | |||
python_files = "test_*[!.txt].py" | |||
python_files = "test_*.py" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MyPyDavid @afuetterer for some reason I still don't understand, this change removed a substantial part of our tests from the CI. The tests run, but they are not included in just running pytest
. This concerned import and export. I should have investigated when the coverage dropped after 2.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, oops 🙈 , strange but good to know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which one was problematic?
test_.py or test_[!.txt].py?
What is the meaning of test_*[!.txt].py?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_*[!.txt].py
. I think @MyPyDavid wanted to exclude files like test_foo_bar.txt.py
, but apparently it does not work that way. It did exclude, e.g. test_view_project_create_import.py
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I got it, all the missing tests got a t
at the end:
test_validator_parent.py
test_viewset_import.py
test_export.py
test_validator_conflict.py
test_view_project.py
test_view_project_create_import.py
test_view_project_update_import.py
test_view_snapshot.py
test_viewset_project.py
test_viewset_project_snapshot.py
test_viewset_snapshot.py
test_viewset_questionset.py
I got the list with pytest --co
with and without the pattern and some grepping.
The pattern means that the file must not end with .tx
before the .py
.
This PR adds the following settings:
PROJECT_CREATE_RESTRICTED
prevents user from creating (or importing) new projectsPROJECT_CREATE_GROUPS
allows users from groups in this list to create projects whenPROJECT_CREATE_RESTRICTED = True
ACCOUNT_GROUPS
is a list of groups which new users, who sign up using the regular allauth signup form, get added to.SOCIALACCOUNT_GROUPS
is a dict of lists of groups which new users, who sign up using the regular allauth signup form, get added to, seperated by provider.E.g.
would move all users, who sign up using the form to the
allauth
group and all users, who login via GitHub to thegithub
group. Only users from the login form can create projects in this case.LDAP and Shibboleth setups can add users to groups using their respective API.