format code

super_sign_new
youngS 4 years ago
parent a0dba04bf2
commit 9f178f5c7f
  1. 1
      fir_ser/api/migrations/0008_auto_20200922_1951.py
  2. 1
      fir_ser/api/migrations/0009_auto_20200925_2041.py
  3. 1
      fir_ser/api/migrations/0010_userinfo_api_token.py
  4. 2
      fir_ser/api/models.py
  5. 3
      fir_ser/api/urls.py
  6. 1
      fir_ser/api/views/__init__.py
  7. 4
      fir_ser/cli.py
  8. 1
      fir_ser/cli/views/login.py
  9. 2
      fir_ser/fir_ser/settings.py

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0007_auto_20200520_1153'),
]

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0008_auto_20200922_1951'),
]

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0009_auto_20200925_2041'),
]

@ -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)

@ -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

@ -4,6 +4,7 @@
# author: liuyu
# date: 2020/10/12
import logging
logger = logging.getLogger(__file__)
try:

@ -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):
@ -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)

@ -22,4 +22,3 @@ logger = logging.getLogger(__name__)
class CliUserInfoView(UserInfoView):
authentication_classes = [ApiTokenAuthentication, ]

@ -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

Loading…
Cancel
Save