feat: add template field for organization model#20
Conversation
There was a problem hiding this comment.
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"), |
There was a problem hiding this comment.
| # 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) |
There was a problem hiding this comment.
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.
| python manage.py init_organization \ | ||
| --org-name="${ORG_NAME}" \ | ||
| --org-slug="spacedf" \ | ||
| --org-template="${ORG_TEMPLATE}" \ |
What?
Add template field for organization model
Why?
From the request
How?
Testing?
Anything Else?