Skip to content

Commit

Permalink
Bulk create students (#259)
Browse files Browse the repository at this point in the history
* rename

* feat: bulk create students

* fix test

* feedback

* use new py package

* feedback

* feedback

* feedback: added unit tests

* feedback
  • Loading branch information
SKairinos authored Feb 1, 2024
1 parent cca63cf commit 8473d03
Show file tree
Hide file tree
Showing 17 changed files with 703 additions and 74 deletions.
2 changes: 1 addition & 1 deletion backend/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ google-cloud-logging = "==1.*"
google-auth = "==2.*"
google-cloud-container = "==2.3.0"
# "django-anymail[amazon_ses]" = "==7.0.*"
codeforlife = {ref = "v0.9.6", git = "https://github.com/ocadotechnology/codeforlife-package-python.git"}
codeforlife = {ref = "v0.11.2", git = "https://github.com/ocadotechnology/codeforlife-package-python.git"}
django = "==3.2.20"
djangorestframework = "==3.13.1"
django-cors-headers = "==4.1.0"
Expand Down
133 changes: 65 additions & 68 deletions backend/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions backend/api/fixtures/non_school_teacher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[
{
"model": "auth.user",
"pk": 22,
"fields": {
"first_name": "John",
"last_name": "Doe",
"username": "[email protected]",
"email": "[email protected]",
"password": "pbkdf2_sha256$720000$Jp50WPBA6WZImUIpj3UcVm$OJWB8+UoW5lLaUkHLYo0cKgMkyRI6qnqVOWxYEsi9T0="
}
},
{
"model": "common.userprofile",
"pk": 22,
"fields": {
"user": 22,
"is_verified": true
}
},
{
"model": "common.teacher",
"pk": 5,
"fields": {
"user": 22,
"new_user": 22
}
}
]
112 changes: 112 additions & 0 deletions backend/api/fixtures/school_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
[
{
"model": "common.school",
"pk": 2,
"fields": {
"name": "School 1",
"country": "GB",
"county": "Hertfordshire"
}
},
{
"model": "auth.user",
"pk": 23,
"fields": {
"first_name": "John",
"last_name": "Doe",
"username": "[email protected]",
"email": "[email protected]",
"password": "pbkdf2_sha256$720000$Jp50WPBA6WZImUIpj3UcVm$OJWB8+UoW5lLaUkHLYo0cKgMkyRI6qnqVOWxYEsi9T0="
}
},
{
"model": "common.userprofile",
"pk": 23,
"fields": {
"user": 23,
"is_verified": true
}
},
{
"model": "common.teacher",
"pk": 6,
"fields": {
"user": 23,
"new_user": 23,
"school": 2
}
},
{
"model": "common.class",
"pk": 6,
"fields": {
"name": "Class 1 @ School 1",
"access_code": "ZZ111",
"teacher": 6
}
},
{
"model": "auth.user",
"pk": 27,
"fields": {
"first_name": "Student1",
"username": "111111111111111111111111111111",
"password": "pbkdf2_sha256$720000$Jp50WPBA6WZImUIpj3UcVm$OJWB8+UoW5lLaUkHLYo0cKgMkyRI6qnqVOWxYEsi9T0="
}
},
{
"model": "common.userprofile",
"pk": 27,
"fields": {
"user": 27,
"is_verified": true
}
},
{
"model": "common.student",
"pk": 17,
"fields": {
"user": 27,
"new_user": 27,
"class_field": 6
}
},
{
"model": "auth.user",
"pk": 24,
"fields": {
"first_name": "Jane",
"last_name": "Doe",
"username": "[email protected]",
"email": "[email protected]",
"password": "pbkdf2_sha256$720000$Jp50WPBA6WZImUIpj3UcVm$OJWB8+UoW5lLaUkHLYo0cKgMkyRI6qnqVOWxYEsi9T0="
}
},
{
"model": "common.userprofile",
"pk": 24,
"fields": {
"user": 24,
"is_verified": true
}
},
{
"model": "common.teacher",
"pk": 7,
"fields": {
"user": 24,
"new_user": 24,
"school": 2,
"is_admin": true
}
},
{
"model": "common.class",
"pk": 7,
"fields": {
"name": "Class 2 @ School 1",
"access_code": "ZZ222",
"teacher": 7
}
}
]
Loading

0 comments on commit 8473d03

Please sign in to comment.