Renamed UserGroup to SchoolClass step 2
This commit is contained in:
parent
b2cac389cf
commit
d273d711c1
|
|
@ -1,4 +1,4 @@
|
||||||
#import "./userGroupParts.gql"
|
#import "./SchoolClassParts.gql"
|
||||||
fragment RoomParts on RoomNode {
|
fragment RoomParts on RoomNode {
|
||||||
id
|
id
|
||||||
slug
|
slug
|
||||||
|
|
@ -7,6 +7,6 @@ fragment RoomParts on RoomNode {
|
||||||
appearance
|
appearance
|
||||||
description
|
description
|
||||||
userGroup {
|
userGroup {
|
||||||
...UserGroupParts
|
...SchoolClassParts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
fragment UserGroupParts on UserGroupNode {
|
fragment SchoolClassParts on SchoolClassNode {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
year
|
year
|
||||||
|
|
|
||||||
|
|
@ -6,4 +6,11 @@ fragment UserParts on UserNode {
|
||||||
firstName
|
firstName
|
||||||
lastName
|
lastName
|
||||||
avatar
|
avatar
|
||||||
|
schoolclassSet {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
...SchoolClassParts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
#import "./fragments/SchoolClassParts.gql"
|
||||||
#import "./fragments/userParts.gql"
|
#import "./fragments/userParts.gql"
|
||||||
query MeQuery {
|
query MeQuery {
|
||||||
me {
|
me {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
#import "./fragments/userGroupParts.gql"
|
|
||||||
query UserGroupsQuery {
|
|
||||||
userGroups {
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
...UserGroupParts
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 2.0.6 on 2018-10-05 08:56
|
# Generated by Django 2.0.6 on 2018-10-05 09:24
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 2.0.6 on 2018-10-05 08:56
|
# Generated by Django 2.0.6 on 2018-10-05 09:24
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
@ -10,9 +10,9 @@ class Migration(migrations.Migration):
|
||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('assignments', '0001_initial'),
|
|
||||||
('books', '0001_initial'),
|
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
('books', '0001_initial'),
|
||||||
|
('assignments', '0001_initial'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 2.0.6 on 2018-10-05 08:56
|
# Generated by Django 2.0.6 on 2018-10-05 09:24
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
|
@ -12,8 +12,8 @@ class Migration(migrations.Migration):
|
||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('wagtailimages', '0021_image_file_hash'),
|
|
||||||
('wagtailcore', '0040_page_draft_title'),
|
('wagtailcore', '0040_page_draft_title'),
|
||||||
|
('wagtailimages', '0021_image_file_hash'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 2.0.6 on 2018-10-05 08:56
|
# Generated by Django 2.0.6 on 2018-10-05 09:24
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ class MutateContentBlock(relay.ClientIDMutation):
|
||||||
|
|
||||||
content_block = get_object(ContentBlock, id_param)
|
content_block = get_object(ContentBlock, id_param)
|
||||||
|
|
||||||
|
# FIXME: usergroup
|
||||||
if visibility_list is not None:
|
if visibility_list is not None:
|
||||||
for v in visibility_list:
|
for v in visibility_list:
|
||||||
user_group = get_object(SchoolClass, v.user_group_id)
|
user_group = get_object(SchoolClass, v.user_group_id)
|
||||||
|
|
|
||||||
|
|
@ -743,5 +743,5 @@ class Command(BaseCommand):
|
||||||
# ContentBlockFactory.create(parent=chapter, **self.filter_data(content_block_data, 'contents'))
|
# ContentBlockFactory.create(parent=chapter, **self.filter_data(content_block_data, 'contents'))
|
||||||
ContentBlockFactory.create(parent=chapter, module=module, **content_block_data)
|
ContentBlockFactory.create(parent=chapter, module=module, **content_block_data)
|
||||||
|
|
||||||
# now create all usergroups and rooms
|
# now create all and rooms
|
||||||
management.call_command('dummy_rooms', verbosity=0)
|
management.call_command('dummy_rooms', verbosity=0)
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ from wagtail.core.models import Site
|
||||||
|
|
||||||
from rooms.factories import RoomFactory, RoomEntryFactory
|
from rooms.factories import RoomFactory, RoomEntryFactory
|
||||||
from rooms.models import Room
|
from rooms.models import Room
|
||||||
from user.factories import UserGroupFactory
|
from user.factories import SchoolClassFactory
|
||||||
|
|
||||||
data = [
|
data = [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
from django.contrib import admin
|
|
||||||
|
|
||||||
from filteredbook.models import Visibility
|
|
||||||
|
|
||||||
|
|
||||||
@admin.register(Visibility)
|
|
||||||
class VisibilityAdmin(admin.ModelAdmin):
|
|
||||||
list_display = ('user_group', 'content_block')
|
|
||||||
list_filter = ('user_group', 'content_block')
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
# Generated by Django 2.0.6 on 2018-10-05 08:56
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
initial = True
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('books', '0001_initial'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Visibility',
|
|
||||||
fields=[
|
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('content_block', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='visible_to', to='books.ContentBlock')),
|
|
||||||
],
|
|
||||||
options={
|
|
||||||
'verbose_name': 'Visibility',
|
|
||||||
'verbose_name_plural': 'Visibilities',
|
|
||||||
},
|
|
||||||
),
|
|
||||||
]
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
# Generated by Django 2.0.6 on 2018-10-05 08:56
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
initial = True
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('user', '0001_initial'),
|
|
||||||
('filteredbook', '0001_initial'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='visibility',
|
|
||||||
name='user_group',
|
|
||||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.SchoolClass'),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
|
|
@ -1,16 +1,2 @@
|
||||||
from django.db import models
|
|
||||||
|
|
||||||
from books.models import ContentBlock
|
|
||||||
from user.models import SchoolClass
|
|
||||||
|
|
||||||
|
|
||||||
class Visibility(models.Model):
|
|
||||||
class Meta:
|
|
||||||
verbose_name = 'Visibility'
|
|
||||||
verbose_name_plural = 'Visibilities'
|
|
||||||
|
|
||||||
user_group = models.ForeignKey(SchoolClass, blank=False, null=False, on_delete=models.CASCADE)
|
|
||||||
content_block = models.ForeignKey(ContentBlock, blank=False, null=False, on_delete=models.CASCADE, related_name='visible_to')
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return 'Visibility {}-{}'.format(self.user_group, self.content_block)
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
from itertools import chain
|
|
||||||
|
|
||||||
import graphene
|
import graphene
|
||||||
from django.db.models import Q
|
|
||||||
from graphene import relay
|
from graphene import relay
|
||||||
from graphene_django import DjangoObjectType
|
from graphene_django import DjangoObjectType
|
||||||
from graphene_django.filter import DjangoFilterConnectionField
|
from graphene_django.filter import DjangoFilterConnectionField
|
||||||
|
|
@ -12,7 +9,7 @@ from books.schema.queries import BookNode, TopicNode, ModuleNode, ContentBlockNo
|
||||||
|
|
||||||
|
|
||||||
class FilteredChapterNode(DjangoObjectType):
|
class FilteredChapterNode(DjangoObjectType):
|
||||||
content_blocks = DjangoFilterConnectionField(ContentBlockNode, user_groups=graphene.List(graphene.String))
|
content_blocks = DjangoFilterConnectionField(ContentBlockNode)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Chapter
|
model = Chapter
|
||||||
|
|
@ -25,26 +22,7 @@ class FilteredChapterNode(DjangoObjectType):
|
||||||
interfaces = (relay.Node,)
|
interfaces = (relay.Node,)
|
||||||
|
|
||||||
def resolve_content_blocks(self, *args, **kwargs):
|
def resolve_content_blocks(self, *args, **kwargs):
|
||||||
user_groups = kwargs.get('user_groups')
|
return ContentBlock.get_by_parent(self)
|
||||||
if user_groups:
|
|
||||||
reduced = []
|
|
||||||
for user_group in user_groups:
|
|
||||||
content_blocks = ContentBlock.get_by_parent(self).exclude(
|
|
||||||
Q(visible_to__user_group__name=user_group)
|
|
||||||
)
|
|
||||||
reduced = chain(reduced, content_blocks)
|
|
||||||
|
|
||||||
filtered = list(set(reduced))
|
|
||||||
return filtered
|
|
||||||
else:
|
|
||||||
return ContentBlock.get_by_parent(self)
|
|
||||||
|
|
||||||
|
|
||||||
class VisibilityNode(DjangoObjectType):
|
|
||||||
class Meta:
|
|
||||||
model = Chapter
|
|
||||||
filter_fields = ['user_group', 'content_block']
|
|
||||||
interfaces = (relay.Node,)
|
|
||||||
|
|
||||||
|
|
||||||
class BookQuery(object):
|
class BookQuery(object):
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 2.0.6 on 2018-10-05 08:56
|
# Generated by Django 2.0.6 on 2018-10-05 09:24
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 2.0.6 on 2018-10-05 08:56
|
# Generated by Django 2.0.6 on 2018-10-05 09:24
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
@ -10,9 +10,9 @@ class Migration(migrations.Migration):
|
||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('objectives', '0001_initial'),
|
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
('books', '0002_contentblock_hidden_for'),
|
('books', '0002_contentblock_hidden_for'),
|
||||||
|
('objectives', '0001_initial'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
@ -5,8 +5,8 @@ from rooms.models import Room, RoomEntry
|
||||||
|
|
||||||
@admin.register(Room)
|
@admin.register(Room)
|
||||||
class RoomAdmin(admin.ModelAdmin):
|
class RoomAdmin(admin.ModelAdmin):
|
||||||
list_display = ('id', 'slug', 'title', 'user_group', 'appearance')
|
list_display = ('id', 'slug', 'title', 'school_class', 'appearance')
|
||||||
list_filter = ('user_group', 'appearance')
|
list_filter = ('school_class', 'appearance')
|
||||||
|
|
||||||
|
|
||||||
@admin.register(RoomEntry)
|
@admin.register(RoomEntry)
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,7 @@ from django.contrib.auth import get_user_model
|
||||||
from factory import CREATE_STRATEGY
|
from factory import CREATE_STRATEGY
|
||||||
from wagtail.core.rich_text import RichText
|
from wagtail.core.rich_text import RichText
|
||||||
|
|
||||||
from books.blocks import ImageUrlBlock
|
from books.factories import TextBlockFactory, ImageUrlBlockFactory, LinkBlockFactory
|
||||||
from books.factories import TextBlockFactory, BasicKnowledgeBlockFactory, ImageUrlBlockFactory, LinkBlockFactory
|
|
||||||
from core.factories import fake, fake_paragraph
|
from core.factories import fake, fake_paragraph
|
||||||
from rooms.models import Room, RoomEntry
|
from rooms.models import Room, RoomEntry
|
||||||
from user.models import SchoolClass
|
from user.models import SchoolClass
|
||||||
|
|
@ -18,7 +17,7 @@ class RoomFactory(factory.django.DjangoModelFactory):
|
||||||
model = Room
|
model = Room
|
||||||
|
|
||||||
title = factory.LazyAttribute(lambda x: fake.sentence(nb_words=random.randint(4, 8)))
|
title = factory.LazyAttribute(lambda x: fake.sentence(nb_words=random.randint(4, 8)))
|
||||||
user_group = factory.Iterator(SchoolClass.objects.all())
|
school_class = factory.Iterator(SchoolClass.objects.all())
|
||||||
appearance = factory.LazyAttribute(lambda x: random.choice(['red', 'green', 'brown']))
|
appearance = factory.LazyAttribute(lambda x: random.choice(['red', 'green', 'brown']))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@ import graphene
|
||||||
from graphene import InputObjectType
|
from graphene import InputObjectType
|
||||||
|
|
||||||
from books.schema.inputs import ContentElementInput
|
from books.schema.inputs import ContentElementInput
|
||||||
from user.inputs import UserGroupInput
|
from user.inputs import SchoolClassInput
|
||||||
|
|
||||||
|
|
||||||
class RoomInput(InputObjectType):
|
class RoomInput(InputObjectType):
|
||||||
title = graphene.String()
|
title = graphene.String()
|
||||||
description = graphene.String()
|
description = graphene.String()
|
||||||
user_group = UserGroupInput()
|
school_class = SchoolClassInput()
|
||||||
appearance = graphene.String()
|
appearance = graphene.String()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 2.0.6 on 2018-10-05 08:56
|
# Generated by Django 2.0.6 on 2018-10-05 09:24
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django_extensions.db.fields
|
import django_extensions.db.fields
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 2.0.6 on 2018-10-05 08:56
|
# Generated by Django 2.0.6 on 2018-10-05 09:24
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
@ -10,9 +10,9 @@ class Migration(migrations.Migration):
|
||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
('rooms', '0001_initial'),
|
('rooms', '0001_initial'),
|
||||||
('user', '0001_initial'),
|
('user', '0001_initial'),
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
|
@ -28,7 +28,7 @@ class Migration(migrations.Migration):
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='room',
|
model_name='room',
|
||||||
name='user_group',
|
name='school_class',
|
||||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.SchoolClass'),
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.SchoolClass'),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
@ -13,11 +13,11 @@ class Room(TitleSlugDescriptionModel):
|
||||||
verbose_name = 'Raum'
|
verbose_name = 'Raum'
|
||||||
verbose_name_plural = 'Räume'
|
verbose_name_plural = 'Räume'
|
||||||
|
|
||||||
user_group = models.ForeignKey(SchoolClass, blank=False, null=False, on_delete=models.CASCADE)
|
school_class = models.ForeignKey(SchoolClass, blank=False, null=False, on_delete=models.CASCADE)
|
||||||
appearance = models.CharField(blank=True, null=False, max_length=255)
|
appearance = models.CharField(blank=True, null=False, max_length=255)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return 'Room {}-{}-{}'.format(self.id, self.title, self.user_group)
|
return 'Room {}-{}-{}'.format(self.id, self.title, self.school_class)
|
||||||
|
|
||||||
|
|
||||||
class RoomEntry(TitleSlugDescriptionModel):
|
class RoomEntry(TitleSlugDescriptionModel):
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ from graphene import relay
|
||||||
|
|
||||||
from api.utils import get_object
|
from api.utils import get_object
|
||||||
from rooms.inputs import UpdateRoomArgument, AddRoomArgument, AddRoomEntryArgument
|
from rooms.inputs import UpdateRoomArgument, AddRoomArgument, AddRoomEntryArgument
|
||||||
from rooms.models import Room, RoomEntry
|
from rooms.models import Room
|
||||||
from rooms.schema import RoomNode, RoomEntryNode
|
from rooms.schema import RoomNode, RoomEntryNode
|
||||||
from rooms.serializers import RoomSerializer, RoomEntrySerializer
|
from rooms.serializers import RoomSerializer, RoomEntrySerializer
|
||||||
from user.models import SchoolClass
|
from user.models import SchoolClass
|
||||||
|
|
@ -15,6 +15,7 @@ class MutateRoom(relay.ClientIDMutation):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def mutate_and_get_payload(cls, *args, **kwargs):
|
def mutate_and_get_payload(cls, *args, **kwargs):
|
||||||
|
# FIXME
|
||||||
room_data = kwargs.get('room')
|
room_data = kwargs.get('room')
|
||||||
user_group = get_object(SchoolClass, room_data.get('user_group').get('id'))
|
user_group = get_object(SchoolClass, room_data.get('user_group').get('id'))
|
||||||
room_data['user_group'] = user_group.id
|
room_data['user_group'] = user_group.id
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ class ContentsSerializer(serializers.Field):
|
||||||
class RoomSerializer(serializers.ModelSerializer):
|
class RoomSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Room
|
model = Room
|
||||||
fields = ('id', 'title', 'description', 'slug', 'user_group', 'appearance',)
|
fields = ('id', 'title', 'description', 'slug', 'school_class', 'appearance',)
|
||||||
read_only_fields = ('id', 'slug',)
|
read_only_fields = ('id', 'slug',)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ admin.site.register(User, UserAdmin)
|
||||||
|
|
||||||
|
|
||||||
@admin.register(SchoolClass)
|
@admin.register(SchoolClass)
|
||||||
class UserGroupAdmin(admin.ModelAdmin):
|
class SchoolClassAdmin(admin.ModelAdmin):
|
||||||
list_display = ('id', 'name', 'year')
|
list_display = ('id', 'name', 'year')
|
||||||
list_filter = ('year',)
|
list_filter = ('year',)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ class_suffix = ['A', 'B', 'C', 'D', 'E']
|
||||||
# TODO: refactor to have non-overlapping user groups?
|
# TODO: refactor to have non-overlapping user groups?
|
||||||
|
|
||||||
|
|
||||||
class UserGroupFactory(factory.django.DjangoModelFactory):
|
class SchoolClassFactory(factory.django.DjangoModelFactory):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = SchoolClass
|
model = SchoolClass
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import graphene
|
||||||
from graphene import InputObjectType
|
from graphene import InputObjectType
|
||||||
|
|
||||||
|
|
||||||
class UserGroupInput(InputObjectType):
|
class SchoolClassInput(InputObjectType):
|
||||||
id = graphene.ID()
|
id = graphene.ID()
|
||||||
name = graphene.String()
|
name = graphene.String()
|
||||||
year = graphene.Int()
|
year = graphene.Int()
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 2.0.6 on 2018-10-05 08:56
|
# Generated by Django 2.0.6 on 2018-10-05 09:24
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
import django.contrib.auth.models
|
import django.contrib.auth.models
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,5 @@
|
||||||
from core.factories import UserFactory
|
from core.factories import UserFactory
|
||||||
from user.factories import UserGroupFactory
|
from user.factories import SchoolClassFactory
|
||||||
from user.models import School, SchoolRole, UserSchoolRole, DEFAULT_SCHOOL_ID
|
from user.models import School, SchoolRole, UserSchoolRole, DEFAULT_SCHOOL_ID
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -14,4 +14,4 @@ def create_school_with_users(school_name):
|
||||||
for i in range(1, 7):
|
for i in range(1, 7):
|
||||||
student = UserFactory(username='student{}'.format(i))
|
student = UserFactory(username='student{}'.format(i))
|
||||||
UserSchoolRole.objects.create(user=student, school_role=student_role)
|
UserSchoolRole.objects.create(user=student, school_role=student_role)
|
||||||
UserGroupFactory(users=[teacher, student], school=school)
|
SchoolClassFactory(users=[teacher, student], school=school)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue