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
Remove last Option<Vec.. from API. Fixes #2820 #2822
Conversation
&& !local_site_data | ||
.allowed_instances | ||
.iter() | ||
.any(|i| domain.eq(&i.domain)) |
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.
The is_empty check isnt necessary.
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'd thought it wasn't but it fails otherwise. You can check the previous failed CI attempts for that.
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 you need to change it to if local_site_data.allowed_instances.iter().all(|i| domain.ne(&i.domain)) {
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.
That would check to make sure every instance in that allowlist is the domain to be checked. We only want to see if the one to be checked is there or not.
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.
Ah the is_empty is actually to check if allowlist mode is enabled, so it does require a separate check. Could you add a comment to explain that?
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.
Done
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.
Didnt get pushed?
The only
Option<Vec<
's left, are the ones for create / edit API actions, which is correct because those should be optional.