From 91e042ea1decf5e60e86ca394ffa71e8df4f321c Mon Sep 17 00:00:00 2001 From: nineven Date: Sat, 5 Feb 2022 14:37:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=84=AA=E5=8C=96=E4=BB=A3=E7=A2=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_ser/api/views/domain.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fir_ser/api/views/domain.py b/fir_ser/api/views/domain.py index 2d88117..a7bf800 100644 --- a/fir_ser/api/views/domain.py +++ b/fir_ser/api/views/domain.py @@ -81,7 +81,8 @@ class DomainCnameView(APIView): res.data = {'domain_name': '', 'domain_record': '', 'is_enable': False} user_domain_obj = UserDomainInfo.objects.filter(**get_domain_filter(request)).first() domain_name = request.query_params.get("domain_name", '') - if (user_domain_obj and domain_name) or (user_domain_obj and user_domain_obj.domain_type in [0, 2]): + if user_domain_obj and (domain_name or user_domain_obj.domain_type in [0, 2] or ( + domain_name == '' and user_domain_obj.domain_type == 1)): res.data['domain_name'] = user_domain_obj.domain_name res.data['is_enable'] = user_domain_obj.is_enable if user_domain_obj.cname_id: