[Update] 更新移动的model

pull/2462/head
ibuler 2019-03-04 17:07:51 +08:00
parent ad6d233c11
commit 924affd978
2 changed files with 3 additions and 9 deletions

View File

@ -10,8 +10,8 @@ class Migration(migrations.Migration):
]
database_operations = [
migrations.AlterModelTable(name='accesskey', table='autentication_accesskey'),
migrations.AlterModelTable(name='privatetoken', table='autentication_privatetoken'),
migrations.AlterModelTable(name='accesskey', table='authentication_accesskey'),
migrations.AlterModelTable(name='privatetoken', table='authentication_privatetoken'),
migrations.AlterModelTable(name='loginlog', table='audits_userloginlog'),
]

View File

@ -321,8 +321,7 @@ class User(AbstractUser):
pass
def create_access_key(self):
from . import AccessKey
access_key = AccessKey.objects.create(user=self)
access_key = self.access_keys.create()
return access_key
@property
@ -334,11 +333,6 @@ class User(AbstractUser):
return True
return False
def check_public_key(self, public_key):
if self.ssh_public_key == public_key:
return True
return False
def avatar_url(self):
admin_default = settings.STATIC_URL + "img/avatar/admin.png"
user_default = settings.STATIC_URL + "img/avatar/user.png"