Skip to content

Commit

Permalink
Update module 2 check
Browse files Browse the repository at this point in the history
  • Loading branch information
fsoest committed Jan 11, 2025
1 parent efa9bcc commit 663ecd4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion S1/waitinglists/templates/waitinglists/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h4>My Progress</h4>
<div class="col-4">
<div class="card">
<div class="card-body">
<h5 class="card-title">Module 2</h5>
<h5 class="card-title">Module 2</h5> <a class="btn btn-outline-info btn-sm" href="{% url 'update_module' %}">Update</a>
{% for k, v in module_2_detail.items %}
{% if v.1 %}
<p> Module {{ k }} completed on {{ v.0|format_date }} </p>
Expand Down
1 change: 1 addition & 0 deletions S1/waitinglists/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@
views.total_waiting_list,
name="total_waiting_list",
),
path("update_module", views.update_module_2, name="update_module"),
]
8 changes: 7 additions & 1 deletion S1/waitinglists/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,18 @@ def check_modules(cid):
pass


@login_required
def update_module_2(request):
module_2_completion(request.user, fetch=True)
return HttpResponseRedirect(reverse("index"))


@login_required
def index(request):
if not request.user.is_authenticated:
return HttpResponseRedirect(reverse("login"))
user = request.user
module_2_detail, module_2_completed = module_2_completion(user, fetch=True)
module_2_detail, module_2_completed = module_2_completion(user, fetch=False)
is_ger = user.userdetail.subdivision == "GER"
is_moodle_signed_up = send_moodle_find_user(user.username)
waiting_for_modules = []
Expand Down

0 comments on commit 663ecd4

Please sign in to comment.