Skip to content

feat: add template field for organization model#20

Merged
ngovinh2k2 merged 1 commit into
devfrom
feat/add-template-field-for-organization-model
May 13, 2026
Merged

feat: add template field for organization model#20
ngovinh2k2 merged 1 commit into
devfrom
feat/add-template-field-for-organization-model

Conversation

@ngovinh2k2
Copy link
Copy Markdown
Member

What?

Add template field for organization model

Why?

From the request

How?

Testing?

  • Functional Testing
  • Security
  • Performance
  • Error Handling
  • Code Quality
  • Documentation
  • Database
  • Deployment
  • Final Review

Anything Else?

@ngovinh2k2 ngovinh2k2 merged commit 8239272 into dev May 13, 2026
1 check passed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a template field to the Organization model and updates the initialization logic to support it. However, several issues were identified: the --org-template argument is not registered in the init_organization management command, which will cause the startup script to fail. Furthermore, the template value is currently passed to a Celery task but is not yet persisted to the database or included in the organization event payload.

return {
"org_name": kwargs.get("org_name") or os.getenv("ORG_NAME"),
"org_slug": kwargs.get("org_slug") or os.getenv("ORG_SLUG"),
"org_template": kwargs.get("org_template") or os.getenv("ORG_TEMPLATE"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The org_template is being retrieved from kwargs, but the --org-template argument has not been added to the add_arguments method (lines 39-51). This will cause the command to fail with an unrecognized arguments error when called with this flag, as implemented in the docker-entrypoint.sh changes.

# Publish organization event
self._publish_org_event(org_id, org_slug, org_name, result)
self._send_celery_task(org_id, org_name, org_slug, user)
self._send_celery_task(org_id, org_name, org_slug, org_template, user)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The org_template value is passed to the Celery task but is not persisted to the database or included in the organization event. The _create_organization_with_roles method should be updated to save the template field to the Organization model, and _publish_org_event should be updated to include it in the event payload.

Comment thread docker-entrypoint.sh
python manage.py init_organization \
--org-name="${ORG_NAME}" \
--org-slug="spacedf" \
--org-template="${ORG_TEMPLATE}" \
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Adding the --org-template flag here will cause the init_organization command to crash because the argument has not been registered in the command's add_arguments method in bootstrap_service/management/commands/init_organization.py.

@ngovinh2k2 ngovinh2k2 deleted the feat/add-template-field-for-organization-model branch May 22, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant