Skip to content

Commit

Permalink
fix: Remove in-code tracking of primary pack downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
faucomte97 committed Jan 17, 2025
1 parent af85ec9 commit dfb3f74
Show file tree
Hide file tree
Showing 6 changed files with 433 additions and 519 deletions.
917 changes: 426 additions & 491 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cfl_common/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
version=version,
include_package_data=True,
install_requires=[
"django==4.2.17",
"django==4.2.18",
"django-countries==7.6.1",
"django-csp==3.8",
"django-import-export==4.2.0",
Expand Down
11 changes: 4 additions & 7 deletions portal/templates/portal/coding_club.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,9 @@ <h4 class="mt-0">Primary coding club</h4>
</p>
</div>
<div>
<form method="post", action="{% url 'download_student_pack' 3 %}" class="non-styled--form">
{% csrf_token %}
<button id="primary_pack" href="" type="submit" class="button button--primary button--icon">
Download the Primary coding club pack<span class="iconify" data-icon="mdi:tray-arrow-down"></span>
</button>
</form>
<a id="primary_pack" download type="submit" class="button button--primary button--icon" href="https://code-for-life.gitbook.io/code-for-life-primary-club-resources">
Download the Primary coding club pack<span class="iconify" data-icon="mdi:tray-arrow-down"></span>
</a>
</div>
</div>
<div class="col-sm-6 d-flex flex-column">
Expand All @@ -77,7 +74,7 @@ <h4 class="mt-0">Primary coding club</h4>
<h4 class="mt-0">Python coding club</h4>
<p>
Download your FREE coding club pack for students aged 12 and above.
This pack is a fast paced introduction to Python. It is aimed at students already interested
This pack is a fast-paced introduction to Python. It is aimed at students already interested
in learning coding, individuals looking to learn and run their own club, or adults wanting to
try coding out. It is designed to be used in face-to-face or online clubs.
</p>
Expand Down
7 changes: 0 additions & 7 deletions portal/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from django.views.generic.base import TemplateView
from django.views.i18n import JavaScriptCatalog
from game.views.level import play_default_level
from two_factor.urls import urlpatterns as tf_urls
from two_factor.views import (
BackupTokensView,
ProfileView,
Expand Down Expand Up @@ -44,7 +43,6 @@
from portal.views.email import verify_email
from portal.views.home import (
coding_club,
download_student_pack,
home,
home_learning,
logout_view,
Expand Down Expand Up @@ -527,11 +525,6 @@
),
),
re_path(r"^codingClub/$", coding_club, name="codingClub"),
re_path(
r"^codingClub/(?P<student_pack_type>[3-4])/",
download_student_pack,
name="download_student_pack",
),
re_path(
r"^removeFakeAccounts/",
RemoveFakeAccounts.as_view(),
Expand Down
13 changes: 1 addition & 12 deletions portal/views/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import math

from common.helpers.emails import (
NOTIFICATION_EMAIL,
send_email,
send_verification_email,
)
from common.mail import campaign_ids, send_dotdigital_email
Expand All @@ -16,7 +14,7 @@
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import F
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import redirect, render
from django.shortcuts import render
from django.urls import reverse, reverse_lazy
from django.utils import timezone
from django.utils.html import format_html
Expand All @@ -37,8 +35,6 @@
TEN_YEAR_MAP_BANNER,
TEN_YEAR_MAP_HEADLINE,
)
from portal.templatetags.app_tags import cloud_storage
from portal.views.teacher.teach import count_student_pack_downloads_click

LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -281,13 +277,6 @@ def coding_club(request):
)


def download_student_pack(request, student_pack_type):
if request.method == "POST":
count_student_pack_downloads_click(int(student_pack_type))
link = cloud_storage("club_packs/PrimaryCodingClub.zip")
return redirect(link)


def home_learning(request):
return render(
request,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"django-recaptcha==4.0.0",
"pyyaml==6.0.2",
"importlib-metadata==4.13.0",
"reportlab==3.6.13",
"reportlab==4.2.5",
"django-formtools==2.5.1",
"django-otp==1.5.4",
"requests==2.32.2",
Expand Down

0 comments on commit dfb3f74

Please sign in to comment.