diff --git a/paas2/esb/components/bk/apisv2/usermanage/usermanage_component.py b/paas2/esb/components/bk/apisv2/usermanage/usermanage_component.py index 6d58ad65d..0519333c1 100644 --- a/paas2/esb/components/bk/apisv2/usermanage/usermanage_component.py +++ b/paas2/esb/components/bk/apisv2/usermanage/usermanage_component.py @@ -10,6 +10,8 @@ specific language governing permissions and limitations under the License. """ +from django.conf import settings + from common.constants import API_TYPE_Q from components.component import ConfComponent from .toolkit import configs @@ -27,7 +29,9 @@ def handle(self): extra_params["username"] = username request_info = self.get_request_info(extra_params=extra_params) - # request_info = self.get_request_info() + + if not self.request.app_code: + self.request.app_code = getattr(settings, "BK_APP_CODE", "") response = self.outgoing.http_client.request( self.dest_http_method, diff --git a/paas2/esb/components/generic/templates/cmsi/send_mail.py b/paas2/esb/components/generic/templates/cmsi/send_mail.py index 70f03b20f..5aa5448d6 100644 --- a/paas2/esb/components/generic/templates/cmsi/send_mail.py +++ b/paas2/esb/components/generic/templates/cmsi/send_mail.py @@ -122,6 +122,7 @@ def handle(self): } self.response.payload = tools.inject_invalid_usernames(result, err.invalid_usernames) return + data.update(user_data) if not data["sender"]: diff --git a/paas2/esb/components/generic/templates/cmsi/send_sms.py b/paas2/esb/components/generic/templates/cmsi/send_sms.py index 467542edb..f98b50b29 100644 --- a/paas2/esb/components/generic/templates/cmsi/send_sms.py +++ b/paas2/esb/components/generic/templates/cmsi/send_sms.py @@ -76,6 +76,7 @@ def handle(self): "message": force_text(err), } self.response.payload = tools.inject_invalid_usernames(result, err.invalid_usernames) + return data.update(user_data) diff --git a/paas2/esb/conf/default.py b/paas2/esb/conf/default.py index dca90b773..448a14a90 100644 --- a/paas2/esb/conf/default.py +++ b/paas2/esb/conf/default.py @@ -31,6 +31,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +BK_APP_CODE = "bk_apigateway" # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ @@ -277,4 +278,4 @@ def get_loggings(log_level): ESB_ALL_BUFFET_COMPONENTS_CACHE_MAXSIZE = 10 ESB_ALL_BUFFET_COMPONENTS_CACHE_TTL_SECONDS = 300 ESB_BUFFET_COMPONENT_CACHE_MAXSIZE = 1000 -ESB_BUFFET_COMPONENT_CACHE_TTL_SECONDS = 300 \ No newline at end of file +ESB_BUFFET_COMPONENT_CACHE_TTL_SECONDS = 300