Skip to content

Commit b49d061

Browse files
committed
Simplifying auth and permissions, fixing up imports.
1 parent d91585b commit b49d061

42 files changed

Lines changed: 859 additions & 903 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/runConfigurations/Import_Non_Unit_Assignments.xml renamed to .idea/runConfigurations/Import_Assignments.xml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Import_Non_Unit_Tasks.xml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Import_Units.xml

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Initialise.xml

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Run_Server.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,15 @@ staff: school
117117
uv run physics_workload/manage.py importstaff "workload_2425.xlsx" "workload_2526_rolled.xlsx"
118118

119119
unit: school
120-
uv run physics_workload/manage.py loaddata load_function
121-
uv run physics_workload/manage.py importunits "workload_2425.xlsx" 24
120+
uv run physics_workload/manage.py loaddata load_function unit
122121
uv run physics_workload/manage.py importunits "workload_2526_rolled.xlsx" 25
123122

124123
task: unit staff
125-
uv run physics_workload/manage.py importunittasks "workload_2425.xlsx" "workload_2526_rolled.xlsx"
126-
uv run physics_workload/manage.py importnonunittasks "workload_2425.xlsx" "workload_2526_rolled.xlsx"
124+
uv run physics_workload/manage.py loaddata task
125+
uv run physics_workload/manage.py importnonunittasks "workload_2526_rolled.xlsx" 25
127126

128127
assignment: task
129-
uv run physics_workload/manage.py loaddata task
130-
uv run physics_workload/manage.py importassignments "workload_2425.xlsx" "workload_2526_rolled.xlsx"
128+
uv run physics_workload/manage.py importassignments "workload_2526_rolled.xlsx" 25
131129

132130
database:
133131
-rm -rf physics_workload/app/migrations/*.py
@@ -137,7 +135,7 @@ database:
137135
uv run physics_workload/manage.py migrate
138136

139137
superuser:
140-
uv run physics_workload/manage.py shell < ./scripts/make_swm1r18_superuser.py
138+
uv run physics_workload/manage.py makestaff --superuser swm1r18
141139

142140
initialise:
143141
uv run physics_workload/manage.py initialise

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ cd /var/www/
1616
git clone https://github.com/Southampton-RSG/physics-workload
1717
```
1818

19-
Also copy the cut-down spreadsheets derived from the `workload 2425.xlsx` spreadsheet into the same directory as the code.
20-
They aren't included in the repo as they contain personally identifiable data.
19+
Also copy the `workload 2526_rolled.xlsx` spreadsheet into the same directory as the code.
20+
It's not included in the repo as it contains personally identifiable data.
2121

2222
### File Server
2323

@@ -71,12 +71,20 @@ If this is the first time the tool is being run, import the `.csv` data:
7171
sudo docker exec -it physics-workload-django /bin/bash
7272
make clean
7373
make data
74-
make superuser
7574
```
7675

7776
Then, log into the website to link your user account to the site.
78-
The command `make superuser` will then make the `swm1r18` account site staff;
79-
edit the script `make_swm1r18_superuser.py` to change the account.
77+
The command `python physics_workload/manage.py makestaff <account>` will then make the user associated with the 365 account `<account>` site staff;
78+
e.g.
79+
```bash
80+
python physics_workload/manage.py makestaff swm1r18
81+
```
82+
83+
### Manual Tweaks
84+
85+
The output of `make data` should list the Tasks, Staff and Units that weren't able to be automatically imported.
86+
You should then get a file `failed_assignments.csv` out;
87+
this is the lines from the "Staff Tasks" sheet of the Excel file that failed to import.
8088

8189
## Updating
8290

physics_workload/app/auth.py

Lines changed: 0 additions & 49 deletions
This file was deleted.

physics_workload/app/fixtures/task.json

Lines changed: 85 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,91 @@
33
"model": "app.Task",
44
"pk": 1,
55
"fields": {
6-
"title": "1st Year Tutees",
7-
"load_function": 5
6+
"unit": "TUTOR",
7+
"title": "Tuition",
8+
"load_function": 5,
9+
"assignment_students": "REQUIRED"
810
}
911
},
12+
{
13+
"model": "app.Task",
14+
"pk": 2,
15+
"fields": {
16+
"unit": "TUTOR",
17+
"title": "Senior Tutor",
18+
"is_required": true,
19+
"load_fixed": 175,
20+
"assignment_students": "INVALID"
21+
}
22+
},
23+
{
24+
"model": "app.Task",
25+
"pk": 3,
26+
"fields": {
27+
"unit": "TUTOR",
28+
"title": "Additional Senior Tutor",
29+
"load_fixed": 50,
30+
"load_fixed_first": 25,
31+
"assignment_students": "INVALID"
32+
}
33+
},
34+
{
35+
"model": "app.Task",
36+
"pk": 4,
37+
"fields": {
38+
"unit": "TUTOR",
39+
"title": "Drop-In Sessions (S1)",
40+
"load_fixed": 50,
41+
"assignment_students": "INVALID"
42+
}
43+
},
44+
{
45+
"model": "app.Task",
46+
"pk": 5,
47+
"fields": {
48+
"unit": "TUTOR",
49+
"title": "Drop-In Sessions (S2)",
50+
"load_fixed": 50,
51+
"assignment_students": "INVALID"
52+
}
53+
},
54+
{
55+
"model": "app.Task",
56+
"pk": 6,
57+
"fields": {
58+
"unit": "PHYS3018",
59+
"title": "Project Marking",
60+
"assignment_students": "REQUIRED",
61+
"load_function": 1
62+
}
63+
},
64+
{
65+
"model": "app.Task",
66+
"pk": 7,
67+
"fields": {
68+
"unit": "PHYS6006",
69+
"title": "Project Marking",
70+
"assignment_students": "REQUIRED",
71+
"load_function": 2
72+
}
73+
},
74+
{
75+
"model": "app.Task",
76+
"pk": 8,
77+
"fields": {
78+
"title": "Cleanroom Rep",
79+
"load_fixed": 35,
80+
"assignment_students": "INVALID"
81+
}
82+
},
83+
{
84+
"model": "app.Task",
85+
"pk": 9,
86+
"fields": {
87+
"unit": "PHYS6009",
88+
"title": "Dissertation Marking",
89+
"assignment_students": "REQUIRED",
90+
"load_function": 3
91+
}
92+
}
1093
]

physics_workload/app/fixtures/unit.json

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,10 @@
22
{
33
"model": "app.Unit",
44
"fields": {
5-
"name": "Physics from Evidence I",
6-
"code": "PHYS2022",
7-
"has_dissertation": 0,
8-
"has_placement": 0,
5+
"name": "First Year Tutoring",
6+
"code": "TUTOR",
97
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
10-
"students": 109,
11-
"credits": 15
12-
}
13-
},
14-
{
15-
"model": "app.Unit",
16-
"fields": {
17-
"name": "Galaxies",
18-
"code": "PHYS2013",
19-
"academic_group": "A",
20-
"has_dissertation": 0,
21-
"has_placement": 0,
22-
"lectures": 33,
23-
"coursework": 5,
24-
"coursework_mark_fraction": 0.25,
25-
"exam_mark_fraction": 0.75,
26-
"description": "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ",
27-
"students": 54,
28-
"credits": 15
29-
}
30-
},
31-
{
32-
"model": "app.Unit",
33-
"fields": {
34-
"name": "MPhys with Indsutrial Placement",
35-
"code": "PHYS6027",
36-
"has_dissertation": 0,
37-
"has_placement": 1,
38-
"description": "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
39-
"students": 2,
40-
"credits": 15
8+
"students": 0
419
}
4210
}
4311
]

0 commit comments

Comments
 (0)