Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

统一users中类命名规则,避免GroupManage与dao层父类同名 #231

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions OpsManage/views/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.http import QueryDict
from django.views.generic import View
from django.contrib.auth.mixins import LoginRequiredMixin
from dao.users import UsersManage,GroupManage
from dao.users import UsersManage,GroupsManage
from django.contrib.auth.decorators import permission_required
from utils.base import method_decorator_adaptor

Expand All @@ -33,7 +33,7 @@ def post(self, request, *args, **kwagrs):
return JsonResponse({'msg':"操作成功","code":200,'data':res})


class GroupManage(LoginRequiredMixin,GroupManage,View):
class GroupManage(LoginRequiredMixin,GroupsManage,View):
login_url = '/login/'
def get(self, request, *args, **kwagrs):
if request.GET.get('type'):
Expand Down
6 changes: 3 additions & 3 deletions dao/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,17 @@ def modf_user_assets(self,request):
return "用户不存在"


class GroupManage(PermsManage):
class GroupsManage(PermsManage):

def __init__(self):
super(GroupManage, self).__init__()
super(GroupsManage, self).__init__()

def allowcator(self,sub,args):
if hasattr(self,sub):
func= getattr(self,sub)
return func(args)
else:
logger.error(msg="GroupManage没有{sub}方法".format(sub=sub))
logger.error(msg="GroupsManage没有{sub}方法".format(sub=sub))
return "参数错误"

def get_group(self,request):
Expand Down