Skip to content

Commit

Permalink
feat(core): Link Organization to ticket
Browse files Browse the repository at this point in the history
ref: #274 #426
  • Loading branch information
jon-nfc committed Dec 19, 2024
1 parent 85914f4 commit 5c324af
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/core/lib/slash_commands/linked_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ def command_linked_model(self, match) -> str:

item_type = TicketLinkedItem.Modules.OPERATING_SYSTEM

elif model_type == 'organization':

from access.models import Organization

model = Organization

item_type = TicketLinkedItem.Modules.ORGANIZATION

elif model_type == 'service':

from itim.models.services import Service
Expand Down
5 changes: 5 additions & 0 deletions app/core/models/ticket/ticket_linked_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Modules(models.IntegerChoices):
SOFTWARE = 6, 'Software'

KB = 7, 'Knowledge Base Article'
ORGANIZATION = 8, 'Organization'

is_global = None

Expand Down Expand Up @@ -123,6 +124,10 @@ def __str__(self) -> str:

item_type = 'operating_system'

elif self.item_type == TicketLinkedItem.Modules.ORGANIZATION:

item_type = 'organization'

elif self.item_type == TicketLinkedItem.Modules.SERVICE:

item_type = 'service'
Expand Down

0 comments on commit 5c324af

Please sign in to comment.