Browse Source

perf: 修改 OPTION 获取字段 org_id label 为 Organization ID

pull/9244/head
Bai 2 years ago
parent
commit
ed35ac2930
  1. 3
      apps/common/drf/metadata.py

3
apps/common/drf/metadata.py

@ -8,6 +8,7 @@ from collections import OrderedDict
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
from django.http import Http404 from django.http import Http404
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
from rest_framework import exceptions, serializers from rest_framework import exceptions, serializers
from rest_framework.fields import empty from rest_framework.fields import empty
from rest_framework.metadata import SimpleMetadata from rest_framework.metadata import SimpleMetadata
@ -125,6 +126,8 @@ class SimpleMetadataWithFilters(SimpleMetadata):
if field.field_name == 'id': if field.field_name == 'id':
field_info['label'] = 'ID' field_info['label'] = 'ID'
if field.field_name == 'org_id':
field_info['label'] = _('Organization ID')
return field_info return field_info

Loading…
Cancel
Save