codeforlife-portal 8.2.0__py2.py3-none-any.whl → 8.2.2__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: codeforlife-portal
3
- Version: 8.2.0
3
+ Version: 8.2.2
4
4
  Classifier: Programming Language :: Python
5
5
  Classifier: Programming Language :: Python :: 3.12
6
6
  Classifier: Framework :: Django
@@ -111,7 +111,7 @@ example_project/portal_test_settings.py,sha256=mTyObCGkZEI0IQSZkqCjb1WZ7ebjQLwui
111
111
  example_project/settings.py,sha256=pHQDI_A_yXV3u1efj689tc-vPI6nBFma4gMMPBzj0aI,5652
112
112
  example_project/urls.py,sha256=FUTzHPlUS1O5kqMHjL5V4L552N2ln7uTDXcw9wjKUto,422
113
113
  example_project/wsgi.py,sha256=U1W6WzZxZaIdYZ5tks7w9fqp5WS5qvn2iThsVcskrWw,829
114
- portal/__init__.py,sha256=Xb24P8T6pG5QQaEw-UTO0iybyDoxvRGJaUR_qFoVAJQ,22
114
+ portal/__init__.py,sha256=qHoUgbIt6pjWzUYt9wXlO8qcrd9dEl09FyPsRTkJshI,22
115
115
  portal/admin.py,sha256=RKJizTF6dPJKmGPZw7nZUM0X8jkiTjgyKhLQxtvHJ0I,6148
116
116
  portal/app_settings.py,sha256=DhWLQOwM0zVOXE3O5TNKbMM9K6agfLuCsHOdr1J7xEI,651
117
117
  portal/backends.py,sha256=2Dss6_WoQwPuDzJUF1yEaTQTNG4eUrD12ujJQ5cp5Tc,812
@@ -129,7 +129,7 @@ portal/forms/invite_teacher.py,sha256=jkDNcCfkts4_lXRzhcI3xBam21Zn2yX9wMpMVhDtW1
129
129
  portal/forms/organisation.py,sha256=QcQyd7AiqBmvt4y8uQSQylguUbKOKqo2pjqWIkpWjDg,7433
130
130
  portal/forms/play.py,sha256=j_QYAKb4qyW0uy0VUUG49dmzDLINc3jR6ddK-djrbc4,11523
131
131
  portal/forms/registration.py,sha256=a-TuzikRc0Q-BAYs3rJ3Sz1wmQ1o_rTEtZmWdF7-xss,6008
132
- portal/forms/teach.py,sha256=wVwHP2odgMmEGGbbPQzak_1tqutcr1GWZcadvC1Bffg,21739
132
+ portal/forms/teach.py,sha256=c0t9XLfQJFd8hDWbnMUGX15Nt_XDXFG2BfwAKizE-Uw,22381
133
133
  portal/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
134
134
  portal/helpers/captcha.py,sha256=Amwg3HZ9eIh1LGYVYWYruk1ccNj6P3nYP_evufOY8BY,254
135
135
  portal/helpers/decorators.py,sha256=Bs6AVCvcgxfHLdJVWzTmZpxlYbJZXJh5e9AGRXf7cwo,3617
@@ -454,7 +454,7 @@ portal/templates/portal/locked_out.html,sha256=JeiFHFyueFX03D54k82swjxvKY78cFG8V
454
454
  portal/templates/portal/locked_out_school_student.html,sha256=bcpLtu4mkHR-zILLuArtHH2OfUSjHiqntcdbTMlx5Kg,684
455
455
  portal/templates/portal/mouseflow.html,sha256=ji9SWR86nqC59xdmivfdPNG5OzFk8gJEUeOUUh52alk,361
456
456
  portal/templates/portal/play.html,sha256=ETfPEVoWeWC8Jwwrr_2WaxYM_TyV4EHkq1l3RuKtrRM,5604
457
- portal/templates/portal/privacy_notice.html,sha256=USklp2FWK4yEpa_-UGYrOutC4lORBMIxqcQihvCLTSA,56338
457
+ portal/templates/portal/privacy_notice.html,sha256=hZ41kpPeymv1leH1LAbVB98nVczf-m2-Fj79jH8DqFY,56482
458
458
  portal/templates/portal/register.html,sha256=4RqUxRiQOvd-oHAM5x6U01zdlYRfy-h8NUGl8UIiBC0,12531
459
459
  portal/templates/portal/reset_password.html,sha256=YzsREz5D2OwhicMLahVOVDXiNDxoHlPqU5iu96i36W0,1373
460
460
  portal/templates/portal/reset_password_confirm.html,sha256=jPHSDatezRXzCG4zH_5BQPWAxLblidqro0hzvsH54ho,3499
@@ -492,7 +492,7 @@ portal/templates/portal/tag_manager/tag_manager_body.html,sha256=M_c9T2cfmVm6_Gj
492
492
  portal/templates/portal/tag_manager/tag_manager_head.html,sha256=kWQ4ccJ062cWRJOcfTNaWYTxCmzDsB9JD5v_YdyO5Ic,1288
493
493
  portal/templates/portal/teach/base_registering.html,sha256=jpANyRQbsmWO404l9Mez91zolNP9ic1khWi27WW0FMQ,582
494
494
  portal/templates/portal/teach/class.html,sha256=zir7a7y4hbg9E6-zFIC0iv8kccIzF-qkni4DXlvkjgM,6726
495
- portal/templates/portal/teach/dashboard.html,sha256=SwNdLbTDPaz0O7wVlSVkU8KwIWPzBYsOo6ysOxkOwOc,32674
495
+ portal/templates/portal/teach/dashboard.html,sha256=DcY6rcUjAT9h6VbSIA3mq4fyCIATIlWYDH2qMU1LySg,32697
496
496
  portal/templates/portal/teach/invited.html,sha256=lTsydONG5se1E099KaRgsxGuG12qVHxFUL2X0E3HBmQ,4188
497
497
  portal/templates/portal/teach/onboarding_classes.html,sha256=K212dunXG7eByyCg5lhv4ne-SniMz3kcKXrfianIY6g,2872
498
498
  portal/templates/portal/teach/onboarding_print.html,sha256=4vD2ZDNRxERNdCNj3ZNXJWYAFBQPn9C7Pzsz5TZjZHw,8862
@@ -537,7 +537,7 @@ portal/tests/test_2FA.py,sha256=0N4C9Ab3TvO9W__oQLCo-fLDH1Ho3CiGGsSg-2TiZUE,3597
537
537
  portal/tests/test_admin.py,sha256=AM2dgv8j9m4L-SDO-sMA9tQvQH9GwRBrlwRG9OgqtfI,1451
538
538
  portal/tests/test_api.py,sha256=Yo5s_nEGOoG35jA39yZ6nuDOUZvuCZ8o8o8XhZos61w,13819
539
539
  portal/tests/test_captcha_forms.py,sha256=Yn_VYO_6jbq6AeKeLcv-YFL1YwXZpU0C3y7SK8fRUm4,1033
540
- portal/tests/test_class.py,sha256=MfR8fRsi0XjqS5cbeV19y3Be2RVhOLUHsAy_mjm7P70,17644
540
+ portal/tests/test_class.py,sha256=_P2CEtqH67MM9h6MMQB_PxXFyQj4tZZbN42NJQpIJ7o,18308
541
541
  portal/tests/test_emails.py,sha256=pLr06j3uMBxP1raoZQWzUTBVFvsEDFtUh85J8OnqCwE,9238
542
542
  portal/tests/test_global_forms.py,sha256=GIm_oSN4VsfaO--E2SMRu8CwVraan0UBj-_LE_tu8w0,833
543
543
  portal/tests/test_helper_methods.py,sha256=-SQCDZm2XUtyXGEp0CHIb_SSC9CPD-XOSnpnY8QclHk,890
@@ -613,7 +613,7 @@ portal/views/api.py,sha256=mdWmFkV5mxmR-mvj6ttIe8uwW9tbcx9-5ykk5dpX0LI,7047
613
613
  portal/views/dotmailer.py,sha256=OH06IXuqqjhQbEie8g8y2ZY1oZvsCtNHhkQRLa-julg,2467
614
614
  portal/views/email.py,sha256=V3wXRxIjeZ4OJBVqGCQrPn-GQWKZK1PCXbR1f2Zpa_4,2174
615
615
  portal/views/home.py,sha256=8leK4ADxRg-gK-bm7D08CR44bhV3I8lt5pCV59HXMkk,9619
616
- portal/views/legal.py,sha256=nUunsTHnhMcXBcDlg1GmUal86k9Vhinne4A2FWfq78M,342
616
+ portal/views/legal.py,sha256=9m143zbEchH-U-2PCMuT25ErtZT4jQER5EgcFLb8gpk,348
617
617
  portal/views/organisation.py,sha256=sPDbiM7hdtpF8GKyh_4n4VPl2a-WnAgnF4q9aSvQCVI,3341
618
618
  portal/views/play_landing_page.py,sha256=FFmjUFub3ZdlbMqkB8yX3jAImCzqrUqgb8AZcpKywZ4,308
619
619
  portal/views/registration.py,sha256=9cDKFVXVyJcMJBVZLwHoucMI4UwsOhbUxMdcxIEOixs,10889
@@ -634,8 +634,8 @@ portal/views/two_factor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
634
634
  portal/views/two_factor/core.py,sha256=Lk32z2SN2Pg0rRkK-N-LXMvXC1kKKsH3l692kiSDQ4E,964
635
635
  portal/views/two_factor/form.py,sha256=lnHNKI-BMlpncTuW3zUzjPaJJNuEra2I_nOam0eOKFY,257
636
636
  portal/views/two_factor/profile.py,sha256=SHSg_xHccE5PtD-OfuOkYhREYz_er4bj5ro1RjJ88Yw,393
637
- codeforlife_portal-8.2.0.dist-info/LICENSE.md,sha256=9AbRlCDqD2D1tPibimysFv3zg3AIc49-eyv9aEsyq9w,115
638
- codeforlife_portal-8.2.0.dist-info/METADATA,sha256=ZSsWDJV-GTrgYnPCZ2sb5Q2_y3c2c_RaLoTN3QZudd4,3077
639
- codeforlife_portal-8.2.0.dist-info/WHEEL,sha256=Kh9pAotZVRFj97E15yTA4iADqXdQfIVTHcNaZTjxeGM,110
640
- codeforlife_portal-8.2.0.dist-info/top_level.txt,sha256=8e5pdsuIoTqEAMqpelHBjGjLbffcBtgOoggmd2q7nMw,41
641
- codeforlife_portal-8.2.0.dist-info/RECORD,,
637
+ codeforlife_portal-8.2.2.dist-info/LICENSE.md,sha256=9AbRlCDqD2D1tPibimysFv3zg3AIc49-eyv9aEsyq9w,115
638
+ codeforlife_portal-8.2.2.dist-info/METADATA,sha256=HyPeuAGr6YZvKArvEGwYJMPTTsd8WcZaHsxqpam71x0,3077
639
+ codeforlife_portal-8.2.2.dist-info/WHEEL,sha256=Kh9pAotZVRFj97E15yTA4iADqXdQfIVTHcNaZTjxeGM,110
640
+ codeforlife_portal-8.2.2.dist-info/top_level.txt,sha256=8e5pdsuIoTqEAMqpelHBjGjLbffcBtgOoggmd2q7nMw,41
641
+ codeforlife_portal-8.2.2.dist-info/RECORD,,
portal/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "8.2.0"
1
+ __version__ = "8.2.2"
portal/forms/teach.py CHANGED
@@ -234,6 +234,16 @@ class ClassCreationForm(forms.Form):
234
234
 
235
235
  self.fields["teacher"].choices = teacher_choices
236
236
 
237
+ def clean(self):
238
+ name = self.cleaned_data.get("class_name", "")
239
+
240
+ if re.match(re.compile("^[\w -]+$"), name) is None:
241
+ raise forms.ValidationError(
242
+ "Class name may only contain letters, numbers, dashes, underscores, and spaces."
243
+ )
244
+
245
+ return self.cleaned_data
246
+
237
247
 
238
248
  class ClassEditForm(forms.Form):
239
249
  # select dropdown choices for potentially limiting time in which external students may join
@@ -288,6 +298,16 @@ class ClassEditForm(forms.Form):
288
298
  widget=forms.Select(),
289
299
  )
290
300
 
301
+ def clean(self):
302
+ name = self.cleaned_data.get("name", "")
303
+
304
+ if re.match(re.compile("^[\w -]+$"), name) is None:
305
+ raise forms.ValidationError(
306
+ "Class name may only contain letters, numbers, dashes, underscores, and spaces."
307
+ )
308
+
309
+ return self.cleaned_data
310
+
291
311
 
292
312
  class ClassLevelControlForm(forms.Form):
293
313
  def __init__(self, *args, **kwargs):
@@ -83,10 +83,10 @@
83
83
  <li><p>Your messages and queries you may send us: when you use the “Contact Us” form or email.</p></li>
84
84
  <li><p>When your account was created and when you last logged into your account: this information is generated
85
85
  at the time your account is created or you log in.</p></li>
86
- <li><p>Technical information, such as the IP address and other information about the device you use to access
87
- the Code for Life portal, and technical information about how you use these (for example, which pages on our
88
- portal you visit, for how long you stay on each page, etc.): when you navigate the portal and allow the use
89
- of non-essential cookies.</p></li>
86
+ <li><p>Technical information about the device you use to access the Code for Life portal (e.g. device type
87
+ and screen resolution), and technical information about how you use these (for example, which pages on
88
+ our portal you visit, for how long you stay on each page, etc.): when you navigate the portal and allow
89
+ the use of non-essential cookies.</p></li>
90
90
  <li><p>Data from Code for Life surveys you may take part in.</p></li>
91
91
  </ul>
92
92
 
@@ -100,10 +100,10 @@
100
100
  <li><p>Your messages and queries you may send us: when you use the “Contact Us” form or email.</p></li>
101
101
  <li><p>When you created an account and when you last logged in to your account: this information is generated at
102
102
  the time you create your account or log in.</p></li>
103
- <li><p>Technical information, such as the IP address and other information about the device you use to access
104
- the Code for Life portal, and technical information about how you use these (for example, which pages on our
105
- portal you visit, for how long you stay on each page, etc.): when you navigate the portal and allow the use
106
- of non-essential cookies.</p></li>
103
+ <li><p>Technical information about the device you use to access the Code for Life portal (e.g. device type
104
+ and screen resolution), and technical information about how you use these (for example, which pages on
105
+ our portal you visit, for how long you stay on each page, etc.): when you navigate the portal and allow
106
+ the use of non-essential cookies.</p></li>
107
107
  <li><p>Data from Code for Life surveys you may take part in.</p></li>
108
108
  <li><p>Your marketing preferences, if you select to sign up to our newsletter.</p></li>
109
109
  <li><p>If you are under 13 years old, we will collect the data of your parent or guardian as you will need to
@@ -119,20 +119,20 @@
119
119
  <li><p>Your messages and queries you may send us: when you use the “Contact Us” form or email.</p></li>
120
120
  <li><p>When you created an account and when you last logged in to your account: this information is generated at
121
121
  the time you create your account or log in.</p></li>
122
- <li><p>Technical information, such as the IP address and other information about the device you use to access
123
- the Code for Life portal, and technical information about how you use these (for example, which pages on our
124
- portal you visit, for how long you stay on each page, etc.): when you navigate the portal and allow the use
125
- of non-essential cookies.</p></li>
122
+ <li><p>Technical information about the device you use to access the Code for Life portal (e.g. device type
123
+ and screen resolution), and technical information about how you use these (for example, which pages on
124
+ our portal you visit, for how long you stay on each page, etc.): when you navigate the portal and allow
125
+ the use of non-essential cookies.</p></li>
126
126
  <li><p>Data from Code for Life surveys you may take part in.</p></li>
127
127
  <li><p>Your marketing preferences, if you select to sign up to our newsletter.</p></li>
128
128
  </ul>
129
129
 
130
130
  <p>If you are a <strong>Website visitor</strong>, we collect:</p>
131
131
  <ul>
132
- <li><p>Technical information, such as the IP address and other information about the device you use to access
133
- the Code for Life portal, and technical information about how you use these (for example, which pages on our
134
- portal you visit, for how long you stay on each page, etc.): when you navigate the portal and allow the use
135
- of non-essential cookies.</p></li>
132
+ <li><p>Technical information about the device you use to access the Code for Life portal (e.g. device type
133
+ and screen resolution), and technical information about how you use these (for example, which pages on
134
+ our portal you visit, for how long you stay on each page, etc.): when you navigate the portal and allow
135
+ the use of non-essential cookies.</p></li>
136
136
  <li><p>Your email address and marketing preferences, if you select to sign up to our newsletter.</p></li>
137
137
  </ul>
138
138
 
@@ -319,14 +319,16 @@
319
319
  and how it is used.</p>
320
320
  <p><strong>Google Analytics</strong>. Our portal uses Google Analytics, which is provided by Google, Inc.
321
321
  ("Google"). Google Analytics uses cookies to help us analyse how users use our portal. The information generated
322
- by the cookie about your use of the website (including your IP address) will be transmitted to and stored by
323
- Google on servers in the United States. Google will use this information for the purpose of evaluating your use
324
- of the website, compiling reports on website activity for website operators and providing other services
325
- relating to website activity and internet usage. Google may also transfer this information to third parties
326
- where required to do so by law, or where such third parties process the information on Google's behalf. Google
327
- will not associate your IP address with any other data held by Google. By accepting analytics / performance
328
- cookies on our portal, you consent to the processing of data about you by Google in the manner and for the
329
- purposes set out above.</p>
322
+ by the cookie about your use of the website will be transmitted to and stored by Google on servers in the
323
+ United States. Google will use this information for the purpose of evaluating your use of the website,
324
+ compiling reports on website activity for website operators and providing other services relating to website
325
+ activity and internet usage. Google may also transfer this information to third parties where required to do
326
+ so by law, or where such third parties process the information on Google's behalf. <strong>Please note: since the
327
+ release of Google Analytics 4, Google Analytics does not log or store IP addresses.</strong> You can read more about
328
+ user data collection by Google Analytics 4 <a href="https://support.google.com/analytics/answer/12017362?hl=en"
329
+ target="_blank">here</a>.
330
+ By accepting analytics / performance cookies on our portal, you consent to the processing of data about you
331
+ by Google in the manner and for the purposes set out above.</p>
330
332
  <p><strong>Mouseflow</strong>. We also use Mouseflow on our portal; this provider offers a website analytics tool
331
333
  that helps us understand how our portal is used, and which areas are mostly used (e.g. by using heatmaps or by
332
334
  replaying your journey on our portal). Mouseflow uses cookies to record information such as when you click on or
@@ -525,8 +527,7 @@
525
527
  <li><p>The code you’ve created on our website,</p></li>
526
528
  <li><p>Any messages you send us when you use the “Contact Us” form or email,</p></li>
527
529
  <li><p>The date your Code for Life account was created and the date you last logged in,</p></li>
528
- <li><p>The IP address (this is a unique number which identifies the device you’ve used to log on to the Code
529
- for Life site) and other information about that device,</p></li>
530
+ <li><p>Information about the device you use to visit the Code for Life site,</p></li>
530
531
  <li><p>Information about how you use the site, such as which pages you’ve visited and how long you stayed on
531
532
  each page. (We will only do this where you have allowed cookies – see the “Cookies and similar
532
533
  technologies” section for more details),
@@ -660,11 +661,11 @@
660
661
  We explain in more detail below what information they collect and how it is used. We do not let other
661
662
  companies show ads on our portal.</p>
662
663
  <p><strong>Google Analytics</strong>. We use Google Analytics (which is run by Google) to help us understand how
663
- you use our site. The information it collects about your use of the website (including your IP address) will
664
- be stored by Google in the United States. Google may pass this information to other organisations who help
665
- them to interpret this information. They may also pass the information to other organisations if the law
666
- says they have to do so. If you choose to allow analytics / performance cookies on our site, you are
667
- consenting to Google using your data for the reasons above.</p>
664
+ you use our site. The information it collects about your use of the website will be stored by Google in the
665
+ United States. Google Analytics does not collect IP addresses. Google may pass this information to other
666
+ organisations who help them to interpret this information. They may also pass the information to other
667
+ organisations if the law says they have to do so. If you choose to allow analytics / performance cookies on
668
+ our site, you are consenting to Google using your data for the reasons above.</p>
668
669
  <p><strong>Mouseflow</strong>. We also use Mouseflow to help us understand how our site is used and which areas
669
670
  are mostly used. It uses cookies to record information such as when you click on or move your mouse, when
670
671
  you scroll or press a key, what pages you visit on our website, how much time you spend on each page, and
@@ -364,7 +364,7 @@
364
364
  </p>
365
365
  {% endif %}
366
366
 
367
- <form autocomplete="off" method="post">
367
+ <form id="form-create-class" autocomplete="off" method="post">
368
368
 
369
369
  {% csrf_token %}
370
370
 
@@ -15,6 +15,7 @@ from django.urls import reverse
15
15
  from game.models import Level
16
16
 
17
17
  from .base_test import BaseTest
18
+ from .pageObjects.portal.home_page import HomePage
18
19
  from .pageObjects.portal.teach.class_page import TeachClassPage
19
20
  from .utils.classes import create_class
20
21
  from .utils.messages import is_class_created_message_showing
@@ -537,3 +538,23 @@ class TestClassFrontend(BaseTest):
537
538
  page, class_name_3 = create_class(page)
538
539
 
539
540
  assert is_class_created_message_showing(self.selenium, class_name_3)
541
+
542
+ def test_create_invalid_name(self):
543
+ email, password = signup_teacher_directly()
544
+ create_organisation_directly(email)
545
+
546
+ class_name = "Class!"
547
+
548
+ self.selenium.get(self.live_server_url)
549
+ page = (
550
+ HomePage(self.selenium)
551
+ .go_to_teacher_login_page()
552
+ .login_no_class(email, password)
553
+ .open_classes_tab()
554
+ )
555
+
556
+ page = page.create_class(class_name, False)
557
+
558
+ assert page.was_form_invalid(
559
+ "form-create-class", "Class name may only contain letters, numbers, dashes, underscores, and spaces."
560
+ )
portal/views/legal.py CHANGED
@@ -5,7 +5,7 @@ def privacy_notice(request):
5
5
  return render(
6
6
  request,
7
7
  "portal/privacy_notice.html",
8
- {"last_updated": "11th April 2024", "last_updated_children": "11th April 2024"},
8
+ {"last_updated": "17th February 2025", "last_updated_children": "17th February 2025"},
9
9
  )
10
10
 
11
11