From 02218e624a0fd9144cdbaca86a1d9545650f6b29 Mon Sep 17 00:00:00 2001 From: liuzheng712 Date: Sun, 4 Oct 2015 19:07:42 +0800 Subject: [PATCH] lots --- jasset/models.py | 4 ++-- jumpserver/settings.py | 2 +- jumpserver/views.py | 1 + juser/user_api.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/jasset/models.py b/jasset/models.py index 0d11ba753..e108d507c 100644 --- a/jasset/models.py +++ b/jasset/models.py @@ -59,8 +59,8 @@ class AssetGroup(models.Model): class Asset(models.Model): - ip = models.IPAddressField(unique=True) - port = models.IntegerField(max_length=6) + ip = models.GenericIPAddressField(unique=True) + port = models.IntegerField() group = models.ManyToManyField(AssetGroup) username = models.CharField(max_length=20, blank=True, null=True) password = models.CharField(max_length=80, blank=True, null=True) diff --git a/jumpserver/settings.py b/jumpserver/settings.py index 3d0977dbd..6eb10c252 100644 --- a/jumpserver/settings.py +++ b/jumpserver/settings.py @@ -77,7 +77,7 @@ INSTALLED_APPS = ( 'juser', 'jasset', 'jperm', - # 'jlog', + 'jlog', ) MIDDLEWARE_CLASSES = ( diff --git a/jumpserver/views.py b/jumpserver/views.py index d628a640f..eed1d4f4f 100644 --- a/jumpserver/views.py +++ b/jumpserver/views.py @@ -15,6 +15,7 @@ from jumpserver.api import * from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from settings import BASE_DIR +from jlog.models import Log def getDaysByNum(num): today = datetime.date.today() diff --git a/juser/user_api.py b/juser/user_api.py index 566f07f68..b1320d32c 100644 --- a/juser/user_api.py +++ b/juser/user_api.py @@ -4,7 +4,7 @@ from Crypto.PublicKey import RSA from juser.models import AdminGroup from jumpserver.api import * - +from jumpserver.settings import BASE_DIR def group_add_user(group, user_id=None, username=None): """