Fix Bug: admin remove itself from a group

Brightcells vor 9 Jahren
Ursprung
Commit
61590ecb17
1 geänderte Dateien mit 1 neuen Zeilen und 1 gelöschten Zeilen
  1. 1 1
      group/views.py

+ 1 - 1
group/views.py

@@ -330,7 +330,7 @@ def group_remove_api(request):
330 330
         return response(GroupStatusCode.GROUP_NOT_FOUND)
331 331
 
332 332
     # 权限校验
333
-    if group.admin_id != admin_id:
333
+    if group.admin_id != admin_id and group_id.admin_id == user_id:  # 管理员也不允许将自己移除
334 334
         return response(GroupStatusCode.NO_REMOVE_PERMISSION)
335 335
 
336 336
     # 群组用户校验