feat(devops): Add model tag feature_flag to ticket linked item

ref: #662 #659
This commit is contained in:
2025-03-04 03:56:57 +09:30
parent 23793e2133
commit 124c96512a
3 changed files with 16 additions and 1 deletions

View File

@ -35,7 +35,9 @@ Describe in detail the following:
- [ ] 🏷️ Model tag added to `app/core/lib/slash_commands/linked_model.CommandLinkedModel.get_model()` function
- [ ] Tag updated in the [docs](https://nofusscomputing.com/projects/centurion_erp/user/core/markdown/#model-reference)
- [ ] 📘 Tag updated in the [docs](https://nofusscomputing.com/projects/centurion_erp/user/core/markdown/#model-reference)
- [ ] tag added to `app/core/models/ticket/ticket_linked_items.TicketLinkedItem.__str__()`
- [ ] tag added to `app/core/lib/slash_commands/linked_model.CommandLinkedModel.get_model()`
- [ ] ⚒️ Migration _Ticket Linked Item item_type choices update_
>[!note]

View File

@ -147,6 +147,11 @@ class TicketLinkedItem(TenancyObject):
item_type = 'team'
else:
item_type = str(self.get_item_type_display()).lower().replace(' ', '_')
if item_type:
return f'${item_type}-{int(self.item)}'

View File

@ -190,6 +190,14 @@ class TicketLinkedItemViewSerializer(TicketLinkedItemModelSerializer):
model = Device
elif item.item_type == TicketLinkedItem.Modules.FEATURE_FLAG:
from devops.serializers.feature_flag import FeatureFlag, BaseSerializer
base_serializer = BaseSerializer
model = FeatureFlag
elif item.item_type == TicketLinkedItem.Modules.KB:
from assistance.serializers.knowledge_base import KnowledgeBase, KnowledgeBaseBaseSerializer