From 63b235de4165912328c64220aab23ea26ed57f04 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Thu, 25 Jul 2019 14:57:39 +0200 Subject: [PATCH 1/3] Add random password to imported users --- server/core/management/commands/import_users.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/core/management/commands/import_users.py b/server/core/management/commands/import_users.py index 1dd90c35..18554ba9 100644 --- a/server/core/management/commands/import_users.py +++ b/server/core/management/commands/import_users.py @@ -33,7 +33,7 @@ class Command(BaseCommand): user, created = User.objects.get_or_create(email=email, username=email) user.first_name = first_name user.last_name = last_name - user.set_unusable_password() + user.set_password(User.objects.make_random_password()) user.save() if row['Rolle'] == 'Lehrer': From d93ffe15345400469a77d42d2cdd276f63014674 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Thu, 25 Jul 2019 16:57:59 +0200 Subject: [PATCH 2/3] Add actions for custom content blocks --- client/src/components/Chapter.vue | 23 +---- client/src/components/ContentBlock.vue | 84 +++++++++++++++---- .../visibility/VisibilityAction.vue | 2 +- 3 files changed, 71 insertions(+), 38 deletions(-) diff --git a/client/src/components/Chapter.vue b/client/src/components/Chapter.vue index d1ed063d..19a50389 100644 --- a/client/src/components/Chapter.vue +++ b/client/src/components/Chapter.vue @@ -10,7 +10,7 @@ + :key="contentBlock.id" v-for="contentBlock in chapter.contentBlocks"> @@ -30,29 +30,8 @@ }, computed: { - filteredContentBlocks() { - return this.chapter && this.chapter.contentBlocks - ? this.chapter.contentBlocks.filter(contentBlock => this.visibleFor(contentBlock, this.currentFilter)) - : []; - }, - currentFilter() { - return this.$store.state.filterForSchoolClass; - }, ...mapGetters(['editModule']) }, - - methods: { - visibleFor(contentBlock, schoolClassId) { - if (contentBlock.userCreated) { - if (schoolClassId === '') { - return true; - } - return contentBlock.visibleFor.map(entry => entry.id).includes(schoolClassId); - } else { - return !contentBlock.hiddenFor.map(entry => entry.id).includes(schoolClassId); - } - } - } } diff --git a/client/src/components/ContentBlock.vue b/client/src/components/ContentBlock.vue index c32c5569..7188df64 100644 --- a/client/src/components/ContentBlock.vue +++ b/client/src/components/ContentBlock.vue @@ -1,15 +1,21 @@