Commit f385eeb7 authored by Davve's avatar Davve

修改问题

parent d386e23d
......@@ -59,10 +59,7 @@ class GroupUpdateOrCreate(APIView):
def post(self, request):
id = request.POST.get('id')
star_ids = list(map(lambda x: x.split(":")[0], json.loads(request.POST.get('star', '[]'))))
try:
group_user_ids = list(map(lambda x: x.split(":")[0], json.loads(request.POST.get('group_users', '[]'))))
except:
group_user_ids = json.loads(request.POST.get('group_users', '[]'))
group_user_ids = list(map(lambda x: x.split(":")[0], json.loads(request.POST.get('group_users', '[]'))))
data = {
'name': request.POST.get('name', ''),
'description': request.POST.get('description', ''),
......
......@@ -51,6 +51,7 @@ class CelebrityUpdateOrCreate(APIView):
return {'data': data}
def post(self, request):
print(request.POST, '------------')
id = request.POST.get('id', '')
gender = request.POST.get('gender')
group_ids = list(set(map(lambda x: x.split(":")[0], json.loads(request.POST.get('groups', '[]')))))
......@@ -90,7 +91,7 @@ class CelebrityRelatedGroup(APIView):
id = request.GET.get('id')
offset = int(request.GET.get('page', 0))
count = int(request.GET.get('limit', 10))
filters = {'star_id': id}
filters = {'star_id': id, 'is_online': True}
try:
data = self.rpc['venus/sun/group/list'](filters=filters, offset=(offset-1) * count, limit=count).unwrap()
except Exception as e:
......
......@@ -53,6 +53,7 @@ MIDDLEWARE = [
]
ROOT_URLCONF = 'sun.urls'
SENTRY_CELERY_ENDPOINT = 'http://45b0ef6a79204d6988b59c32c9dd4bef:fa018677fb4f49be88d2ba61cdc7ee32@sentry.igengmei.com/135'
TEMPLATES = [
{
......
......@@ -41,7 +41,7 @@ def require_login(request, origin=''):
return login_require
def py(password):
def make_password(password):
"""生成密码hash
"""
return make_password(password, None, 'pbkdf2_sha256')
......@@ -271,7 +271,6 @@
star: [],
temp_user_ids: '',
group_users: [],
judge_user_ids: [],
group_identify: '',
tempRoute: {},
......@@ -397,7 +396,7 @@
},
appendUser() {
if (this.temp_user_ids == "") {
this.$message.error('还没输入小组呢~~')
this.$message.error('还没输入用户呢~~')
this.temp_user_ids = ''
return false
}
......@@ -415,8 +414,8 @@
this.$message.error('这条数据错误, 请换条数据')
return
}
this.judge_user_ids.push(response.data.data[0].user_id)
this.tableData.push(...response.data.data)
this.total = this.tableData.length
this.group_users.push(this.temp_user_ids)
this.temp_user_ids = ''
......@@ -427,14 +426,19 @@
let origin_user_ids = [];
var left_user_ids = [];
let select_user_ids = []
for (let i = 0 ;i < this.multipleSelection.length ;i++){
if (this.multipleSelection[i].group_identify === '管理员'){
this.$message.error('请先更换管理员,在进行移除操作~')
return false
}
}
this.del_list.push(...this.multipleSelection)
for (let i = 0; i < this.tableData.length; i++) {
origin_user_ids.push(this.tableData[i].user_id)
origin_user_ids.push(this.tableData[i].user_id + ':' + this.tableData[i].nick_name)
}
for (let i = 0; i < this.multipleSelection.length; i++) {
select_user_ids.push(this.multipleSelection[i].user_id)
select_user_ids.push(this.multipleSelection[i].user_id + ':' + this.multipleSelection[i].nick_name)
}
for (let i = 0; i < origin_user_ids.length; i++) {
if (!isInArray(select_user_ids, origin_user_ids[i])) {
......
......@@ -363,10 +363,10 @@
this.del_list.push(...this.multipleSelection)
for (let i = 0; i < this.tableData.length; i++){
origin_group_ids.push(this.tableData[i].id)
origin_group_ids.push(this.tableData[i].id + ':' + this.tableData[i].name)
}
for (let i = 0; i < this.multipleSelection.length; i++){
select_group_ids.push(this.multipleSelection[i].id)
select_group_ids.push(this.multipleSelection[i].id + ':' + this.multipleSelection[i].name)
}
for (let i =0; i < origin_group_ids.length; i++){
if (!isInArray(select_group_ids ,origin_group_ids[i])){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment