codeforlife-portal 8.0.5__py2.py3-none-any.whl → 8.0.7__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of codeforlife-portal might be problematic. Click here for more details.
- cfl_common/common/migrations/0056_set_non_school_teachers_as_non_admins.py +25 -0
- cfl_common/common/migrations/0057_teacher_teacher__is_admin.py +19 -0
- cfl_common/common/models.py +11 -0
- {codeforlife_portal-8.0.5.dist-info → codeforlife_portal-8.0.7.dist-info}/METADATA +1 -1
- {codeforlife_portal-8.0.5.dist-info → codeforlife_portal-8.0.7.dist-info}/RECORD +10 -8
- portal/__init__.py +1 -1
- portal/templates/portal/teach/teacher_edit_class.html +1 -1
- {codeforlife_portal-8.0.5.dist-info → codeforlife_portal-8.0.7.dist-info}/LICENSE.md +0 -0
- {codeforlife_portal-8.0.5.dist-info → codeforlife_portal-8.0.7.dist-info}/WHEEL +0 -0
- {codeforlife_portal-8.0.5.dist-info → codeforlife_portal-8.0.7.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from django.apps.registry import Apps
|
|
2
|
+
from django.db import migrations
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def set_non_school_teachers_as_non_admins(apps: Apps, *args):
|
|
6
|
+
Teacher = apps.get_model("common", "Teacher")
|
|
7
|
+
|
|
8
|
+
Teacher.objects.filter(
|
|
9
|
+
is_admin=True,
|
|
10
|
+
school__isnull=True,
|
|
11
|
+
).update(is_admin=False)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Migration(migrations.Migration):
|
|
15
|
+
|
|
16
|
+
dependencies = [
|
|
17
|
+
("common", "0055_alter_schoolteacherinvitation_token"),
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
operations = [
|
|
21
|
+
migrations.RunPython(
|
|
22
|
+
code=set_non_school_teachers_as_non_admins,
|
|
23
|
+
reverse_code=migrations.RunPython.noop,
|
|
24
|
+
),
|
|
25
|
+
]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Generated by Django 4.2.17 on 2025-01-13 17:34
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
("common", "0056_set_non_school_teachers_as_non_admins"),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AddConstraint(
|
|
14
|
+
model_name="teacher",
|
|
15
|
+
constraint=models.CheckConstraint(
|
|
16
|
+
check=models.Q(("is_admin", True), ("school__isnull", True), _negated=True), name="teacher__is_admin"
|
|
17
|
+
),
|
|
18
|
+
),
|
|
19
|
+
]
|
cfl_common/common/models.py
CHANGED
|
@@ -126,6 +126,17 @@ class Teacher(models.Model):
|
|
|
126
126
|
|
|
127
127
|
objects = TeacherModelManager()
|
|
128
128
|
|
|
129
|
+
class Meta:
|
|
130
|
+
constraints = [
|
|
131
|
+
models.CheckConstraint(
|
|
132
|
+
check=~models.Q(
|
|
133
|
+
school__isnull=True,
|
|
134
|
+
is_admin=True,
|
|
135
|
+
),
|
|
136
|
+
name="teacher__is_admin",
|
|
137
|
+
)
|
|
138
|
+
]
|
|
139
|
+
|
|
129
140
|
def teaches(self, userprofile):
|
|
130
141
|
if hasattr(userprofile, "student"):
|
|
131
142
|
student = userprofile.student
|
|
@@ -6,7 +6,7 @@ cfl_common/common/apps.py,sha256=49UXZ3bSkFKvIEOL4zM7y1sAhccQJyRtsoOg5XVd_8Y,129
|
|
|
6
6
|
cfl_common/common/context_processors.py,sha256=X0iuX5qu9kMWa7q8osE9CJ2LgM7pPOYQFGdjm8X3rk0,236
|
|
7
7
|
cfl_common/common/csp_config.py,sha256=9ECOLnp60ENRFAYEEIoYOMhqQzLgfKA-wkWxeUBwDrQ,2824
|
|
8
8
|
cfl_common/common/mail.py,sha256=pIRfUMVoJWxdv74UqToj_0_pTVTC51z6QlFVLI3QBOw,6874
|
|
9
|
-
cfl_common/common/models.py,sha256=
|
|
9
|
+
cfl_common/common/models.py,sha256=_uD8pIO5fGVbOD8NydJVIzpiEDAaR2hIfpOhDT6jB34,16106
|
|
10
10
|
cfl_common/common/permissions.py,sha256=gC6RQGZI2QDBbglx-xr_V4Hl2C2nf1V2_uPmEuoEcJo,2416
|
|
11
11
|
cfl_common/common/utils.py,sha256=Nn2Npao9Uqad5Js_IdHwF-ow6wrPNpBLW4AO1LxoEBc,1727
|
|
12
12
|
cfl_common/common/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -69,6 +69,8 @@ cfl_common/common/migrations/0052_add_cse_fields.py,sha256=NhUkkcu2EBzJFhewCTccQ
|
|
|
69
69
|
cfl_common/common/migrations/0053_clean_class_data.py,sha256=lBKlDa49YwT660o-Ot6IYe4I1KfervTn4uAijda0nyw,584
|
|
70
70
|
cfl_common/common/migrations/0054_delete_aimmo_models.py,sha256=fmn4mDdlHr5DhPbIl_ygvGwWVFD8TZHAgQ6VUQQgCx8,415
|
|
71
71
|
cfl_common/common/migrations/0055_alter_schoolteacherinvitation_token.py,sha256=lzPAMaI3zU_q25RuIos_LV97NXOa3MIn_eWaEL71Y4I,403
|
|
72
|
+
cfl_common/common/migrations/0056_set_non_school_teachers_as_non_admins.py,sha256=_BrC9yfSYpP-c7EGFZmz8a4Kx_SxnRhpLMxJ70RVFOY,603
|
|
73
|
+
cfl_common/common/migrations/0057_teacher_teacher__is_admin.py,sha256=4pinm9T3JF3PRNLnbXI6mdFiNyxg1MnRs8lMKC4S5Bc,511
|
|
72
74
|
cfl_common/common/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
73
75
|
cfl_common/common/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
76
|
cfl_common/common/tests/test_migration_anonymise_orphan_schools.py,sha256=wJRyPgRvBsXLSCFdbBi2GXjgSgDbKUTRiM31CXIvpqs,1194
|
|
@@ -108,7 +110,7 @@ example_project/portal_test_settings.py,sha256=7Q7SdosA0Ba85qz-xkAe3EHyMPpSIQ61C
|
|
|
108
110
|
example_project/settings.py,sha256=NjFhtDNLwdY5vhUAtqk9a9m3GRfcuWRVqIqnJ3u0o6E,5658
|
|
109
111
|
example_project/urls.py,sha256=FUTzHPlUS1O5kqMHjL5V4L552N2ln7uTDXcw9wjKUto,422
|
|
110
112
|
example_project/wsgi.py,sha256=U1W6WzZxZaIdYZ5tks7w9fqp5WS5qvn2iThsVcskrWw,829
|
|
111
|
-
portal/__init__.py,sha256=
|
|
113
|
+
portal/__init__.py,sha256=R91ZhDdp1RFN8qHzUX8g2PziduG-lxKY1L7jJUsoLAI,22
|
|
112
114
|
portal/admin.py,sha256=RKJizTF6dPJKmGPZw7nZUM0X8jkiTjgyKhLQxtvHJ0I,6148
|
|
113
115
|
portal/app_settings.py,sha256=DhWLQOwM0zVOXE3O5TNKbMM9K6agfLuCsHOdr1J7xEI,651
|
|
114
116
|
portal/backends.py,sha256=2Dss6_WoQwPuDzJUF1yEaTQTNG4eUrD12ujJQ5cp5Tc,812
|
|
@@ -498,7 +500,7 @@ portal/templates/portal/teach/onboarding_students.html,sha256=09q658n7U7Vuzy_M_0
|
|
|
498
500
|
portal/templates/portal/teach/teacher_add_external_student.html,sha256=Lrrh4W3EwxxXKe45kcqzf2BcPxYo_mLahGIQMNJjX9E,2453
|
|
499
501
|
portal/templates/portal/teach/teacher_added_external_student.html,sha256=f18RhP5PCE13yjBTrQTCwPLZnkcZb0bDUZ_Z2Oh3D3I,1189
|
|
500
502
|
portal/templates/portal/teach/teacher_dismiss_students.html,sha256=_5FvvtNjdYpZaM9lDzXrhhTjAD3NK_92kDYzh7xqowI,4283
|
|
501
|
-
portal/templates/portal/teach/teacher_edit_class.html,sha256=
|
|
503
|
+
portal/templates/portal/teach/teacher_edit_class.html,sha256=BWjNK7_i28frww0RiJdxuh7-jbIpfz5rCG2Sl9CAHCU,13369
|
|
502
504
|
portal/templates/portal/teach/teacher_edit_student.html,sha256=JNF8JyoZh0J-oKH4dz7SGSxR0t7J1lbTGLvjhNbk2Rw,3237
|
|
503
505
|
portal/templates/portal/teach/teacher_move_all_classes.html,sha256=u9PNJHrKaIXd67vuwhgMmVXumgSnkKH4QKx1bd3O2VY,1780
|
|
504
506
|
portal/templates/portal/teach/teacher_move_students.html,sha256=toBtjtpiCwvxo2FTJX5oZDzJ9batXdi7ty5AiCHnq4s,1591
|
|
@@ -631,8 +633,8 @@ portal/views/two_factor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
|
631
633
|
portal/views/two_factor/core.py,sha256=Lk32z2SN2Pg0rRkK-N-LXMvXC1kKKsH3l692kiSDQ4E,964
|
|
632
634
|
portal/views/two_factor/form.py,sha256=lnHNKI-BMlpncTuW3zUzjPaJJNuEra2I_nOam0eOKFY,257
|
|
633
635
|
portal/views/two_factor/profile.py,sha256=SHSg_xHccE5PtD-OfuOkYhREYz_er4bj5ro1RjJ88Yw,393
|
|
634
|
-
codeforlife_portal-8.0.
|
|
635
|
-
codeforlife_portal-8.0.
|
|
636
|
-
codeforlife_portal-8.0.
|
|
637
|
-
codeforlife_portal-8.0.
|
|
638
|
-
codeforlife_portal-8.0.
|
|
636
|
+
codeforlife_portal-8.0.7.dist-info/LICENSE.md,sha256=9AbRlCDqD2D1tPibimysFv3zg3AIc49-eyv9aEsyq9w,115
|
|
637
|
+
codeforlife_portal-8.0.7.dist-info/METADATA,sha256=TcnjGRqnNqZjCzDzOsu-hzwLjRP0tmk1javSVcyEbMI,3078
|
|
638
|
+
codeforlife_portal-8.0.7.dist-info/WHEEL,sha256=Kh9pAotZVRFj97E15yTA4iADqXdQfIVTHcNaZTjxeGM,110
|
|
639
|
+
codeforlife_portal-8.0.7.dist-info/top_level.txt,sha256=8e5pdsuIoTqEAMqpelHBjGjLbffcBtgOoggmd2q7nMw,41
|
|
640
|
+
codeforlife_portal-8.0.7.dist-info/RECORD,,
|
portal/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "8.0.
|
|
1
|
+
__version__ = "8.0.7"
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
{% for level in episode.levels %}
|
|
186
186
|
{% for worksheet in episode.worksheets %}
|
|
187
187
|
{% if worksheet.before_level == level.id %}
|
|
188
|
-
<p>{{episode.name}}</p>
|
|
188
|
+
<p>{{episode.name}}{% if episode.worksheets|length > 1 %} pt. {{ forloop.counter }}{% endif %}</p>
|
|
189
189
|
{% endif %}
|
|
190
190
|
{% endfor %}
|
|
191
191
|
{% if level.name < 1010 %}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|