cfl-common 5.3.0__py3-none-any.whl → 8.9.15__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.
Files changed (92) hide show
  1. cfl_common-8.9.15.dist-info/METADATA +47 -0
  2. cfl_common-8.9.15.dist-info/RECORD +99 -0
  3. {cfl_common-5.3.0.dist-info → cfl_common-8.9.15.dist-info}/WHEEL +1 -1
  4. common/app_settings.py +35 -5
  5. common/csp_config.py +85 -0
  6. common/fixtures/aimmo_characters.json +30 -30
  7. common/fixtures/aimmo_characters2.json +1 -1
  8. common/fixtures/aimmo_characters3.json +35 -0
  9. common/helpers/data_migration_loader.py +3 -4
  10. common/helpers/emails.py +228 -108
  11. common/helpers/generators.py +1 -1
  12. common/helpers/organisation.py +10 -0
  13. common/mail.py +201 -0
  14. common/migrations/0002_emailverification.py +1 -3
  15. common/migrations/0005_add_worksheets.py +2 -13
  16. common/migrations/0007_add_pdf_names_to_first_two_worksheets.py +2 -14
  17. common/migrations/0008_unlock_worksheet_3.py +1 -6
  18. common/migrations/0011_student_login_id.py +3 -3
  19. common/migrations/0012_usersession.py +39 -0
  20. common/migrations/0013_class_school.py +42 -0
  21. common/migrations/0014_login_type.py +29 -0
  22. common/migrations/0015_dailyactivity.py +31 -0
  23. common/migrations/0016_joinreleasestudent.py +42 -0
  24. common/migrations/0017_copy_email_to_username.py +18 -0
  25. common/migrations/0018_update_aimmo_character_image_path.py +15 -0
  26. common/migrations/0019_aimmocharacter_alt.py +16 -0
  27. common/migrations/0020_class_is_active_and_null_access_code.py +23 -0
  28. common/migrations/0021_school_is_active.py +28 -0
  29. common/migrations/0022_school_cleanup.py +29 -0
  30. common/migrations/0023_userprofile_aimmo_badges.py +22 -0
  31. common/migrations/0024_teacher_invited_by.py +25 -0
  32. common/migrations/0025_schoolteacherinvitation.py +47 -0
  33. common/migrations/0026_teacher_remove_join_request.py +22 -0
  34. common/migrations/0027_class_created_by.py +25 -0
  35. common/migrations/0028_coding_club_downloads.py +23 -0
  36. common/migrations/0029_dynamicelement.py +22 -0
  37. common/migrations/0030_add_maintenance_banner.py +25 -0
  38. common/migrations/0031_improve_admin_panel.py +56 -0
  39. common/migrations/0032_dailyactivity_level_control_submits.py +18 -0
  40. common/migrations/0033_password_reset_tracking_fields.py +23 -0
  41. common/migrations/0034_dailyactivity_daily_school_student_lockout_reset.py +18 -0
  42. common/migrations/0035_rename_lockout_fields.py +27 -0
  43. common/migrations/0036_rename_awaiting_email_verification_userprofile_is_verified.py +17 -0
  44. common/migrations/0037_migrate_email_verification.py +21 -0
  45. common/migrations/0038_delete_emailverification.py +16 -0
  46. common/migrations/0039_copy_email_to_username.py +18 -0
  47. common/migrations/0040_school_county.py +18 -0
  48. common/migrations/0041_populate_gb_counties.py +27 -0
  49. common/migrations/0042_totalactivity.py +25 -0
  50. common/migrations/0043_add_total_activity.py +30 -0
  51. common/migrations/0044_update_activity_models.py +33 -0
  52. common/migrations/0045_otp.py +23 -0
  53. common/migrations/0046_alter_school_country.py +19 -0
  54. common/migrations/0047_delete_school_postcode.py +16 -0
  55. common/migrations/0048_unique_school_names.py +42 -0
  56. common/migrations/0049_anonymise_orphan_users.py +29 -0
  57. common/migrations/0050_anonymise_orphan_schools.py +30 -0
  58. common/migrations/0051_verify_returning_users.py +26 -0
  59. common/migrations/0052_add_cse_fields.py +68 -0
  60. common/migrations/0053_clean_class_data.py +24 -0
  61. common/migrations/0054_delete_aimmo_models.py +20 -0
  62. common/migrations/0055_alter_schoolteacherinvitation_token.py +18 -0
  63. common/migrations/0056_set_non_school_teachers_as_non_admins.py +25 -0
  64. common/migrations/0057_teacher_teacher__is_admin.py +19 -0
  65. common/migrations/0058_userprofile_google_refresh_token_and_more.py +24 -0
  66. common/models.py +347 -63
  67. common/permissions.py +20 -8
  68. common/static/common/img/RR_logo.svg +336 -0
  69. common/static/common/img/brain.svg +1 -0
  70. common/templates/common/onetrust_cookies_consent_notice.html +6 -6
  71. common/tests/test_migration_anonymise_orphan_schools.py +30 -0
  72. common/tests/test_migration_anonymise_orphan_users.py +30 -0
  73. common/tests/test_migration_blocked_time.py +3 -11
  74. common/tests/test_migration_remove_teacher_title.py +1 -3
  75. common/tests/test_migration_unique_school_names.py +33 -0
  76. common/tests/test_migration_verify_returning_users.py +59 -0
  77. common/tests/test_models.py +49 -43
  78. common/tests/utils/classes.py +1 -3
  79. common/tests/utils/email.py +11 -49
  80. common/tests/utils/organisation.py +10 -14
  81. common/tests/utils/student.py +14 -67
  82. common/tests/utils/teacher.py +16 -38
  83. common/tests/utils/user.py +1 -3
  84. cfl_common-5.3.0.dist-info/METADATA +0 -20
  85. cfl_common-5.3.0.dist-info/RECORD +0 -48
  86. common/email_messages.py +0 -218
  87. common/fixtures/unlock_worksheet3.json +0 -20
  88. common/fixtures/worksheets.json +0 -98
  89. common/fixtures/worksheets2.json +0 -110
  90. common/tests/test_migration_aimmo_characters.py +0 -31
  91. common/tests/test_migration_worksheets.py +0 -49
  92. {cfl_common-5.3.0.dist-info → cfl_common-8.9.15.dist-info}/top_level.txt +0 -0
@@ -1,110 +0,0 @@
1
- [
2
- {
3
- "model": "aimmo.worksheet",
4
- "pk": 1,
5
- "fields": {
6
- "name": "Present Day I: The Museum",
7
- "description": "While working at the Scriptsonian museum for class credit, you have accidentally activated the mysterious Kurono time machine! The museum\u2019s valuable artefacts are scattered across the shelves, the floor, the whole spacetime continuum. It\u2019s going to take more than just a backpack to collect them all. You need to use the Kurono time machine to get them back \u2013 but before jumping in you need to learn how to use its navigation system. This challenge shows you how to move around the map so you don\u2019t run into problems in the future\u2026or past.",
8
- "short_description": "While working at the Scriptsonian museum for class credit, you have accidentally activated the mysterious Kurono time machine!",
9
- "image_path": "images/worksheets/future.jpg",
10
- "active_image_path": "images/worksheets/future_active.png",
11
- "era": 1,
12
- "thumbnail_text": "",
13
- "thumbnail_image_path": "images/worksheets/lock.png",
14
- "teacher_pdf_name": "Kurono_teacher_guide_1",
15
- "student_pdf_name": "Kurono_challenge_1",
16
- "sort_order": 100,
17
- "starter_code": "def next_turn(world_state, avatar_state):\r\n new_dir = direction.NORTH\r\n # Your code goes here\r\n action = MoveAction(new_dir)\r\n return action"
18
- }
19
- },
20
- {
21
- "model": "aimmo.worksheet",
22
- "pk": 2,
23
- "fields": {
24
- "name": "Present Day II",
25
- "description": "Now that you know how to navigate, it\u2019s time to clean up the evidence before leaving this timeline! Some of the artefacts escaped the vortex and ended up all over the museum - if each of you picks ten of them up, you should be done in time to embark in your journey. But beware! The blue artefacts will need to be separated from the red ones, as they have opposing magnetic fields. Can you tell which one is what type?",
26
- "short_description": "Now that you know how to navigate, it\u2019s time to clean up the evidence before leaving this timeline!",
27
- "image_path": "images/worksheets/future.jpg",
28
- "active_image_path": "images/worksheets/future2_active.png",
29
- "era": 1,
30
- "thumbnail_text": "",
31
- "thumbnail_image_path": "images/worksheets/lock.png",
32
- "teacher_pdf_name": "Kurono_teacher_guide_2",
33
- "student_pdf_name": "Kurono_challenge_2",
34
- "sort_order": 200,
35
- "starter_code": "def next_turn(world_state, avatar_state):\r\n new_dir = direction.NORTH\r\n # Your code goes here\r\n action = MoveAction(new_dir)\r\n return action"
36
- }
37
- },
38
- {
39
- "model": "aimmo.worksheet",
40
- "pk": 3,
41
- "fields": {
42
- "name": "Ancient",
43
- "description": "You are now familiar with your equipment and have managed to unlock the gateway to the first time checkpoint. You find yourself in a strange place, full of familiar structures in the form of ruins. After a few minutes, you hear steps and realise you\u2019re not alone! No time to move around aimlessly now, or you might run into someone! Use your navigating system to scan your surroundings and move only towards the artefacts you want to pick up. Be stealthy!",
44
- "short_description": "You find yourself in a strange place, full of familiar structures in the form of ruins.",
45
- "image_path": "images/worksheets/ancient.jpg",
46
- "active_image_path": "images/worksheets/ancient_active.png",
47
- "era": 2,
48
- "thumbnail_text": "Coming Soon",
49
- "thumbnail_image_path": "",
50
- "teacher_pdf_name": "",
51
- "student_pdf_name": "",
52
- "sort_order": 300,
53
- "starter_code": "def next_turn(world_state, avatar_state):\r\n new_dir = direction.NORTH\r\n # Your code goes here\r\n action = MoveAction(new_dir)\r\n return action"
54
- }
55
- },
56
- {
57
- "model": "aimmo.worksheet",
58
- "pk": 4,
59
- "fields": {
60
- "name": "21st Century",
61
- "description": "After successfully collecting all the missing artefacts from the first time checkpoint, you arrive at what looks like the 21st century. You recognise some cars parked here and there, old-fashioned roads and houses like the ones your history teacher told you about. On the bright side, you seem to be alone and safe to walk around... for now. A more recent timeline doesn\u2019t make artefacts easier to find, though. Or at least not the right ones. In this timeline there seems to be an amount of falsified objects that resemble the ones you\u2019re looking for, but aren\u2019t quite genuine. These will have no value in the museum. Your navigation system will be able to tell you whether an object is genuine or not, but it\u2019s up to you to decide which ones to bring back!",
62
- "short_description": "After successfully collecting all the missing artefacts from the first time checkpoint, you arrive at what looks like the 21st century.",
63
- "image_path": "images/worksheets/modern.jpg",
64
- "active_image_path": "images/worksheets/modern_active.png",
65
- "era": 3,
66
- "thumbnail_text": "Coming Soon",
67
- "thumbnail_image_path": "",
68
- "teacher_pdf_name": "",
69
- "student_pdf_name": "",
70
- "sort_order": 400,
71
- "starter_code": "def next_turn(world_state, avatar_state):\r\n new_dir = direction.NORTH\r\n # Your code goes here\r\n action = MoveAction(new_dir)\r\n return action"
72
- }
73
- },
74
- {
75
- "model": "aimmo.worksheet",
76
- "pk": 5,
77
- "fields": {
78
- "name": "Prehistoric",
79
- "description": "Oh no! Looks like the time machine has taken you even further back in time. You find yourself in a place that looks very\u2026 wild. You can hear the occasional distant roaring, added to the buzzing of what sound like gigantic insects. Vegetation is so abundant around you that you can barely move. It might be a good idea to use your navigation system to scan all around you before even trying! And don\u2019t forget to keep track of the portal that\u2019ll send you back to your original timeline - just in case something with sharp teeth starts running towards you.",
80
- "short_description": "Oh no! Looks like the time machine has taken you even further back in time. You find yourself in a place that looks very\u2026 wild.",
81
- "image_path": "images/worksheets/prehistory.jpg",
82
- "active_image_path": "images/worksheets/prehistory_active.png",
83
- "era": 4,
84
- "thumbnail_text": "Coming Soon",
85
- "thumbnail_image_path": "",
86
- "teacher_pdf_name": "",
87
- "student_pdf_name": "",
88
- "sort_order": 500,
89
- "starter_code": "def next_turn(world_state, avatar_state):\r\n new_dir = direction.NORTH\r\n # Your code goes here\r\n action = MoveAction(new_dir)\r\n return action"
90
- }
91
- },
92
- {
93
- "model": "aimmo.worksheet",
94
- "pk": 6,
95
- "fields": {
96
- "name": "Back to the Future",
97
- "description": "You\u2019ve made it! Well, almost. You\u2019re back to your original time, but something seems to be off. The museum is still there, with all the chaos you still need to tidy up, but the environment isn\u2019t quite right. The electronic containers and shelves seem slightly different, and when the AI interlocutor speaks, you don\u2019t recognise the language. It looks like you\u2019ve changed something in the past that affected events in your present! If you manage to extract the metadata from the recovered artefacts, you should be able to find out which timelines they were found in. You can input this text into the Kurono machine to get things back to normal.",
98
- "short_description": "You\u2019ve made it! Well, almost. You\u2019re back to your original time, but something seems to be off.",
99
- "image_path": "images/worksheets/broken_future.jpg",
100
- "active_image_path": "images/worksheets/broken_future_active.png",
101
- "era": 5,
102
- "thumbnail_text": "Coming Soon",
103
- "thumbnail_image_path": "",
104
- "teacher_pdf_name": "",
105
- "student_pdf_name": "",
106
- "sort_order": 600,
107
- "starter_code": "def next_turn(world_state, avatar_state):\r\n new_dir = direction.NORTH\r\n # Your code goes here\r\n action = MoveAction(new_dir)\r\n return action"
108
- }
109
- }
110
- ]
@@ -1,31 +0,0 @@
1
- import pytest
2
- from django.db.models.query import QuerySet
3
-
4
-
5
- @pytest.mark.django_db
6
- def test_characters_added(migrator):
7
- migrator.apply_initial_migration(("common", "0002_emailverification"))
8
- new_state = migrator.apply_tested_migration(("common", "0004_add_aimmocharacters"))
9
-
10
- model_names = [model._meta.db_table for model in new_state.apps.get_models()]
11
-
12
- assert "common_aimmocharacter" in model_names
13
-
14
- AimmoCharacter = new_state.apps.get_model("common", "aimmocharacter")
15
- all_characters: QuerySet = AimmoCharacter.objects.all()
16
-
17
- assert all_characters.count() == 3
18
-
19
-
20
- @pytest.mark.django_db
21
- def test_image_paths_updated(migrator):
22
- migrator.apply_initial_migration(("common", "0005_add_worksheets"))
23
- new_state = migrator.apply_tested_migration(
24
- ("common", "0006_update_aimmo_character_image_path")
25
- )
26
-
27
- AimmoCharacter = new_state.apps.get_model("common", "aimmocharacter")
28
- all_characters: QuerySet = AimmoCharacter.objects.all()
29
-
30
- for character in all_characters:
31
- assert character.image_path.startswith("images/aimmo_characters/")
@@ -1,49 +0,0 @@
1
- import pytest
2
- from django.db.models.query import QuerySet
3
-
4
-
5
- @pytest.mark.django_db
6
- def test_worksheets_added(migrator):
7
- migrator.apply_initial_migration(("common", "0004_add_aimmocharacters"))
8
- new_state = migrator.apply_tested_migration(("common", "0005_add_worksheets"))
9
-
10
- Worksheet = new_state.apps.get_model("aimmo", "worksheet")
11
- all_worksheets: QuerySet = Worksheet.objects.all()
12
-
13
- assert all_worksheets.count() == 6
14
-
15
-
16
- @pytest.mark.django_db
17
- def test_worksheets_pdf_names_added(migrator):
18
- migrator.apply_initial_migration(
19
- ("common", "0006_update_aimmo_character_image_path")
20
- )
21
- new_state = migrator.apply_tested_migration(
22
- ("common", "0007_add_pdf_names_to_first_two_worksheets")
23
- )
24
-
25
- Worksheet = new_state.apps.get_model("aimmo", "worksheet")
26
- worksheet1 = Worksheet.objects.get(id=1)
27
- worksheet2 = Worksheet.objects.get(id=2)
28
-
29
- assert worksheet1.teacher_pdf_name == "Kurono_teacher_guide_1"
30
- assert worksheet1.student_pdf_name == "Kurono_challenge_1"
31
-
32
- assert worksheet2.teacher_pdf_name == "Kurono_teacher_guide_2"
33
- assert worksheet2.student_pdf_name == "Kurono_challenge_2"
34
-
35
-
36
- @pytest.mark.django_db
37
- def test_worksheet_3_is_unlocked(migrator):
38
- migrator.apply_initial_migration(
39
- ("common", "0007_add_pdf_names_to_first_two_worksheets")
40
- )
41
- new_state = migrator.apply_tested_migration(("common", "0008_unlock_worksheet_3"))
42
-
43
- Worksheet = new_state.apps.get_model("aimmo", "worksheet")
44
- worksheet3 = Worksheet.objects.get(id=3)
45
-
46
- assert worksheet3.thumbnail_text == ""
47
- assert worksheet3.thumbnail_image_path == "images/worksheets/lock.png"
48
- assert worksheet3.teacher_pdf_name == "Kurono_teacher_guide_3"
49
- assert worksheet3.student_pdf_name == "Kurono_challenge_3"