Пример #1
0
 def get_protocol_by_application_type(cls, app_type):
     from applications.const import ApplicationTypeChoices
     if app_type in cls.APPLICATION_CATEGORY_PROTOCOLS:
         protocol = app_type
     elif app_type in ApplicationTypeChoices.remote_app_types():
         protocol = cls.PROTOCOL_RDP
     else:
         protocol = None
     return protocol
 def _construct_meta_display_of_open(self):
     meta_display_fields = ['apply_category_display', 'apply_type_display']
     apply_category = self.ticket.meta.get('apply_category')
     apply_category_display = ApplicationCategoryChoices.get_label(apply_category)
     apply_type = self.ticket.meta.get('apply_type')
     apply_type_display = ApplicationTypeChoices.get_label(apply_type)
     meta_display_values = [apply_category_display, apply_type_display]
     meta_display = dict(zip(meta_display_fields, meta_display_values))
     return meta_display