From 9f178f5c7f89484b2c11e4be48814f165a2085d1 Mon Sep 17 00:00:00 2001 From: youngS Date: Fri, 22 Jan 2021 14:55:36 +0800 Subject: [PATCH] format code --- fir_ser/api/migrations/0008_auto_20200922_1951.py | 1 - fir_ser/api/migrations/0009_auto_20200925_2041.py | 1 - fir_ser/api/migrations/0010_userinfo_api_token.py | 1 - fir_ser/api/models.py | 2 +- fir_ser/api/urls.py | 3 ++- fir_ser/api/utils/app/supersignutils.py | 2 +- fir_ser/api/views/__init__.py | 3 ++- fir_ser/cli.py | 6 +----- fir_ser/cli/views/login.py | 1 - fir_ser/fir_ser/settings.py | 6 +++--- 10 files changed, 10 insertions(+), 16 deletions(-) diff --git a/fir_ser/api/migrations/0008_auto_20200922_1951.py b/fir_ser/api/migrations/0008_auto_20200922_1951.py index 1eaa16c..7cd0a7b 100644 --- a/fir_ser/api/migrations/0008_auto_20200922_1951.py +++ b/fir_ser/api/migrations/0008_auto_20200922_1951.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('api', '0007_auto_20200520_1153'), ] diff --git a/fir_ser/api/migrations/0009_auto_20200925_2041.py b/fir_ser/api/migrations/0009_auto_20200925_2041.py index c59e02c..1a3b786 100644 --- a/fir_ser/api/migrations/0009_auto_20200925_2041.py +++ b/fir_ser/api/migrations/0009_auto_20200925_2041.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('api', '0008_auto_20200922_1951'), ] diff --git a/fir_ser/api/migrations/0010_userinfo_api_token.py b/fir_ser/api/migrations/0010_userinfo_api_token.py index 5f0e6a4..a7ee93c 100644 --- a/fir_ser/api/migrations/0010_userinfo_api_token.py +++ b/fir_ser/api/migrations/0010_userinfo_api_token.py @@ -4,7 +4,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ('api', '0009_auto_20200925_2041'), ] diff --git a/fir_ser/api/models.py b/fir_ser/api/models.py index ce4e474..730bf44 100644 --- a/fir_ser/api/models.py +++ b/fir_ser/api/models.py @@ -58,7 +58,7 @@ class UserInfo(AbstractUser): if len(self.uid) < 8: self.uid = make_random_uuid() if len(self.api_token) < 8: - self.api_token = self.uid+generateAlphanumericTokenOfLength(64) + self.api_token = self.uid + generateAlphanumericTokenOfLength(64) super(UserInfo, self).save(*args, **kwargs) diff --git a/fir_ser/api/urls.py b/fir_ser/api/urls.py index 8a8bd3b..65efae5 100644 --- a/fir_ser/api/urls.py +++ b/fir_ser/api/urls.py @@ -15,7 +15,8 @@ Including another URLconf """ from django.urls import path, re_path, include -from api.views.login import LoginView, UserInfoView, RegistView, AuthorizationView, ChangeAuthorizationView, UserApiTokenView +from api.views.login import LoginView, UserInfoView, RegistView, AuthorizationView, ChangeAuthorizationView, \ + UserApiTokenView from api.views.logout import LogoutView from api.views.apps import AppsView, AppInfoView, AppReleaseinfoView from api.views.download import ShortDownloadView diff --git a/fir_ser/api/utils/app/supersignutils.py b/fir_ser/api/utils/app/supersignutils.py index a3b7026..a5d4a0b 100644 --- a/fir_ser/api/utils/app/supersignutils.py +++ b/fir_ser/api/utils/app/supersignutils.py @@ -241,7 +241,7 @@ class IosUtils(object): self.developer_obj.save() send_ios_developer_active_status(self.developer_obj, 'app %s developer %s sign failed %s. disable this developer' % ( - self.app_obj, self.developer_obj, result)) + self.app_obj, self.developer_obj, result)) self.get_developer_auth() self.resign() return diff --git a/fir_ser/api/views/__init__.py b/fir_ser/api/views/__init__.py index d58bcb5..5d3d247 100644 --- a/fir_ser/api/views/__init__.py +++ b/fir_ser/api/views/__init__.py @@ -4,9 +4,10 @@ # author: liuyu # date: 2020/10/12 import logging + logger = logging.getLogger(__file__) try: from api.utils.crontab import run except Exception as e: - logger.error("import crontab.run failed Exception:%s" % (e)) \ No newline at end of file + logger.error("import crontab.run failed Exception:%s" % (e)) diff --git a/fir_ser/cli.py b/fir_ser/cli.py index 2fd6f52..25976f2 100644 --- a/fir_ser/cli.py +++ b/fir_ser/cli.py @@ -33,7 +33,6 @@ def upload_qiniuyunoss(key, token, file_path): raise AssertionError(info.text) - class FLY_CLI_SER(object): def __init__(self, fly_cli_domain, fly_cli_token): @@ -44,7 +43,7 @@ class FLY_CLI_SER(object): "APIAUTHORIZATION": fly_cli_token } - def get_upload_token(self, bundleid, type): + def get_upload_token(self, bundleid, type): url = '%s/api/v2/fir/server/analyse' % self.fly_cli_domain data = {"bundleid": bundleid, "type": type} req = requests.post(url, json=data, headers=self._header) @@ -63,7 +62,6 @@ class FLY_CLI_SER(object): return raise AssertionError(req.text) - def upload_local_storage(self, upload_key, upload_token, app_id, file_path): url = '%s/api/v2/fir/server/upload' % self.fly_cli_domain m = MultipartEncoder(fields={ @@ -87,7 +85,6 @@ class FLY_CLI_SER(object): return raise AssertionError(req.text) - def upload_app(self, app_path): appobj = AppInfo(app_path) appinfo = appobj.get_app_data() @@ -264,4 +261,3 @@ if __name__ == '__main__': if os.path.isfile(app_path): fly_obj.upload_app(app_path) raise FileNotFoundError(app_path) - diff --git a/fir_ser/cli/views/login.py b/fir_ser/cli/views/login.py index 5cd41b4..69d4778 100644 --- a/fir_ser/cli/views/login.py +++ b/fir_ser/cli/views/login.py @@ -22,4 +22,3 @@ logger = logging.getLogger(__name__) class CliUserInfoView(UserInfoView): authentication_classes = [ApiTokenAuthentication, ] - diff --git a/fir_ser/fir_ser/settings.py b/fir_ser/fir_ser/settings.py index ae38054..36ed18f 100644 --- a/fir_ser/fir_ser/settings.py +++ b/fir_ser/fir_ser/settings.py @@ -24,7 +24,7 @@ SECRET_KEY = 'j!g@^bc(z(a3*i&kp$_@bgb)bug&^#3=amch!3lz&1x&s6ss6t' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ['127.0.0.1','synchrotron'] +ALLOWED_HOSTS = ['127.0.0.1', 'synchrotron'] # Application definition @@ -171,7 +171,7 @@ REST_FRAMEWORK_EXTENSIONS = { # 注册方式,如果启用sms或者email 需要配置 THIRD_PART_CONFIG.sender 信息 REGISTER = { "enable": True, - "captcha": True, # 是否开启注册字母验证码 + "captcha": True, # 是否开启注册字母验证码 "register_type": { 'sms': False, # 短信注册 'email': True, # 邮件注册 @@ -181,7 +181,7 @@ REGISTER = { # 信息修改也会使用该配置 LOGIN = { - "captcha": True, # 是否开启登录字母验证码 + "captcha": True, # 是否开启登录字母验证码 "login_type": { 'sms': True, # 短信登录 'email': True, # 邮件登录