Fix organization creation when domain is empty#50857
Open
ayushmanayush wants to merge 4 commits into
Open
Conversation
Signed-off-by: ayush <ishusingh1404@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes organization creation when the optional domain field is empty.
Changes:
- Filters blank domains before API conversion.
- Allows blank input in shared domain validation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
Organizations.java |
Treats blank domains as absent. |
OrganizationForm.tsx |
Excludes blank domains from requests. |
|
|
||
| public static void validateDomain(String rawDomain) { | ||
| if (rawDomain == null) { | ||
| if (rawDomain == null || isBlank(rawDomain)) { |
Comment on lines
+24
to
+26
| domains: org.domains | ||
| ?.filter((d) => d.trim() !== "") | ||
| .map((d) => ({ name: d, verified: false })), |
|
|
||
| public static void validateDomain(String rawDomain) { | ||
| if (rawDomain == null) { | ||
| if (rawDomain == null || isBlank(rawDomain)) { |
|
|
||
| public static void validateDomain(String rawDomain) { | ||
| if (rawDomain == null) { | ||
| if (rawDomain == null || isBlank(rawDomain)) { |
Comment on lines
+24
to
+26
| domains: org.domains | ||
| ?.filter((d) => d.trim() !== "") | ||
| .map((d) => ({ name: d, verified: false })), |
Contributor
Contributor
|
@ayushmanayush All the suggestions from Copilot appear to be valid. Please fix them before we proceed with further review. |
Author
|
Ok I'll further look into it and update asap |
Comment on lines
+24
to
+26
| domains: org.domains | ||
| ?.filter((d) => d.trim() !== "") | ||
| .map((d) => ({ name: d, verified: false })), |
Contributor
|
@ayushmanayush We need you to sign your commits so that DCO will pass. |
Signed-off-by: ayush <ishusingh1404@gmail.com>
Contributor
|
I think all commits need to be signed-off for the DCO check to pass. So either add the sign-off or, better yet, squash them into one |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the regression introduced in 26.7.0 where creating an organization
without specifying a domain results in an "Invalid domain format" error.
Root cause
The frontend converted empty domain values into domain objects, causing
validation to fail even though the domain field is optional.
Solution
Filter out empty domain values before creating the domain objects so that
validation is only applied to non-empty domains.
Fixes #50825