Skip to content

Commit

Permalink
Merge branch 'development' into extra_checks
Browse files Browse the repository at this point in the history
# Conflicts:
#	backend/authentication/fixtures/users.yaml
#	backend/poetry.lock
#	backend/pyproject.toml
  • Loading branch information
EwoutV committed Apr 8, 2024
2 parents d594cf7 + 7d32837 commit 57e0ebb
Show file tree
Hide file tree
Showing 36 changed files with 1,301 additions and 178 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ frontend/cypress/videos/*


!data/nginx/ssl/.gitkeep
!data/nginx/nginx.dev.conf
!data/nginx/nginx.test.conf
!data/nginx/nginx.prod.conf
27 changes: 26 additions & 1 deletion backend/api/fixtures/groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,36 @@
students:
- '1'
- '2'
- '000200694919'
- model: api.group
pk: 3
fields:
project: 123456
project: 2
score: 8
students: []
- model: api.group
pk: 4
fields:
project: 2
score: 8
students:
- '1'
- model: api.group
pk: 5
fields:
project: 2
score: 8
students:
- '2'

- model: api.group
pk: 6
fields:
project: 2
score: 8
students:
- '3'

- model: api.group
pk: 2
fields:
Expand All @@ -21,3 +45,4 @@
- '1'
- '2'
- '3'
- '000200694919'
15 changes: 14 additions & 1 deletion backend/api/fixtures/projects.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- model: api.project
pk: 123456
fields:
name: sel2
name: sel1
description: make a project
visible: true
archived: false
Expand All @@ -22,3 +22,16 @@
group_size: 3
max_score: 20
course: 1

- model: api.project
pk: 2
fields:
name: sel2
description: make a project, but better and more fun than the previous one because it's the second one and we learned from the first one
visible: true
archived: false
start_date: 2024-02-26 00:00:00+00:00
deadline: 2024-02-27 00:00:00+00:00
group_size: 3
max_score: 20
course: 1
6 changes: 6 additions & 0 deletions backend/api/fixtures/students.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
- 1
- model: api.student
pk: '3'
fields:
student_id: null
courses:
- 1
- model: api.student
pk: '000200694919'
fields:
student_id: null
courses:
Expand Down
15 changes: 15 additions & 0 deletions backend/api/fixtures/submissions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@
submission_number: 2
submission_time: "2021-01-02T00:00:00Z"
structure_checks_passed: True
- model: api.submission
pk: 3
fields:
group: 4
submission_number: 1
submission_time: "2021-01-02T00:00:00Z"
structure_checks_passed: True
- model: api.submission
pk: 4
fields:
group: 4
submission_number: 2
submission_time: "2021-01-02T00:00:00Z"
structure_checks_passed: True


- model: api.submissionfile
pk: 1
Expand Down
Empty file.
21 changes: 21 additions & 0 deletions backend/api/management/commands/makeAdmin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from django.core.management.base import BaseCommand
from api.models.student import Student


class Command(BaseCommand):

help = 'seed the db with data'

def add_arguments(self, parser):
parser.add_argument('username', type=str, help='The username of the student user to make admin')

def handle(self, *args, **options):
username = options['username']
student = Student.objects.filter(username=username)
if student.count() == 0:
self.stdout.write(self.style.ERROR('User not found, first log in !'))
return
student = student.get()
student.is_staff = True
student.save()
self.stdout.write(self.style.SUCCESS('Successfully made yourself admin!'))
Loading

0 comments on commit 57e0ebb

Please sign in to comment.