Conversation
…eld for the credentialed access policy.
45c5a27 to
8484ba3
Compare
| ) | ||
|
|
||
| if self.access_policy not in {AccessPolicy.CREDENTIALED, AccessPolicy.CONTRIBUTOR_REVIEW}: | ||
| if self.access_policy in {AccessPolicy.OPEN, AccessPolicy.RESTRICTED}: |
There was a problem hiding this comment.
The logic here could be clearer. It's unclear how the current set of statements are organised. My preference would be a set of if else statements, working through each access policy, e.g.
if open: do x
elif restricted: do y
etc
…ld when no training has been selected for the project.
|
@tompollard, I've modified the code to preselect the "No training required" option when the field is empty or was previously set to no training. Now it appears like this when editing a project that does not require training:
|
|
Looks good to me @Chrystinne. One minor thing is that the published project includes an empty "Training required:" section. This section should either:
|
|
@tompollard Thanks, Tom. I've updated this section to display "No training required" if there are no training requirements:
|
tompollard
left a comment
There was a problem hiding this comment.
Thanks Chrystinne, looks good to me!



This PR allows the waiving of training submissions for credentialed access type. This modification has been implemented to support the release of the Bridge2AI project.
The PR modifies the handling of required trainings for credentialed access policy in the
AccessMetadataForm.The empty_field option doesn't work for the current AccessMetadataForm as it triggers the error "" is not a valid value (see image below):
To fix that issue, we needed to add a custom
CustomModelMultipleChoiceFieldto allow 'No training required' as a valid option to be selected by the authors when no training is required.All the following tests passed:
Creation and publication of a new project P1 with credentialed access type with no training required, and testing the access with different types of users:
Creation and publication of a new project P2 with credentialed access type with CITI training required, and testing the access with different types of users:
Creation and publication of a new version of project P1 keeping the same information as the previous version, and testing the access with different types of users:
Creation and publication of a new version of project P2 keeping the same information as the previous version, and testing the access with different types of users:
Creation and publication of a new version of project P1 changing the information of the previous version (i.e., required training information), and testing the access with different types of users:
Creation and publication of a new version of project P2 changing the information of the previous version (i.e., required training information), and testing the access with different types of users: