mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Hackie workaround for lack of GroupInformation
This commit is contained in:
@@ -8,6 +8,7 @@ from django.contrib import messages
|
|||||||
from django.contrib.auth.models import Group
|
from django.contrib.auth.models import Group
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
|
|
||||||
|
from groups.models import GroupInformation
|
||||||
from groups.app_defines import *
|
from groups.app_defines import *
|
||||||
from groups.forms import GroupRequestForm
|
from groups.forms import GroupRequestForm
|
||||||
|
|
||||||
@@ -28,6 +29,10 @@ def group_list(request):
|
|||||||
# Process the query into a list of tuples including status
|
# Process the query into a list of tuples including status
|
||||||
group_list = []
|
group_list = []
|
||||||
for group in set(groups):
|
for group in set(groups):
|
||||||
|
|
||||||
|
if not group.groupinformation:
|
||||||
|
GroupInformation(group=group).save()
|
||||||
|
|
||||||
if request.user in group.groupinformation.admins.all():
|
if request.user in group.groupinformation.admins.all():
|
||||||
status = "Admin"
|
status = "Admin"
|
||||||
elif request.user in group.user_set.all():
|
elif request.user in group.user_set.all():
|
||||||
|
|||||||
Reference in New Issue
Block a user