Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/app/models/onboarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class OnboardingRequest(SQLModel):

organization_name: str = Field(
description="Name of the organization to be created or linked",
min_length=3,
min_length=1,
max_length=100,
)
Comment on lines 25 to 29
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Block whitespace-only org names.

With min_length=1, inputs like " " will pass validation. Add a regex constraint to require at least one non-whitespace character.

Apply this minimal diff:

     organization_name: str = Field(
         description="Name of the organization to be created or linked",
-        min_length=1,
+        min_length=1,
+        pattern=r".*\S.*",
         max_length=100,
     )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
organization_name: str = Field(
description="Name of the organization to be created or linked",
min_length=3,
min_length=1,
max_length=100,
)
organization_name: str = Field(
description="Name of the organization to be created or linked",
min_length=1,
pattern=r".*\S.*",
max_length=100,
)
🤖 Prompt for AI Agents
In backend/app/models/onboarding.py around lines 25 to 29, the organization_name
Field allows whitespace-only strings because min_length=1 accepts " " — add a
regex constraint such as regex=r".*\S.*" to require at least one non-whitespace
character (i.e. change the Field call to include regex=r".*\S.*" while keeping
min_length and max_length).

project_name: str = Field(
Expand Down