diff --git a/src/ctfs/templates/ctfs/ctf_info.html b/src/ctfs/templates/ctfs/ctf_info.html
index 228d7a1..19a7ef5 100644
--- a/src/ctfs/templates/ctfs/ctf_info.html
+++ b/src/ctfs/templates/ctfs/ctf_info.html
@@ -8,6 +8,11 @@
{{ ctf.name }}
{% trans "Published date" %} : {{ ctf.pub_date }}
+ {% if date < ctf.pub_date %}
+
+ {% trans "Challenge is not yet available." %}
+
+ {% else %}
{% if description %}
{{ description|safe }}
@@ -37,13 +42,14 @@
{% endif %}
{% endif %}
{% endif %}
+ {% endif %}
{% trans "Solved by" %}
diff --git a/src/ctfs/views.py b/src/ctfs/views.py
index 7f15c08..a5de830 100644
--- a/src/ctfs/views.py
+++ b/src/ctfs/views.py
@@ -46,12 +46,12 @@ def ctf(request, cat_slug, ctf_slug):
profil.last_submission_date = timezone.now()
profil.score += ctf_info.points
profil.save()
- return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'valitated': True, 'description': description})
+ return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'valitated': True, 'description': description, 'date': timezone.now()})
else:
- return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'failed': True, 'description': description})
+ return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'failed': True, 'description': description, 'date': timezone.now()})
else:
- return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'alvalitated': True, 'description': description})
+ return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'alvalitated': True, 'description': description, 'date': timezone.now()})
else:
- return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'description': description})
+ return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'description': description, 'date': timezone.now()})
else:
- return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'alvalitated': flagged, 'description': description})
+ return render(request, 'ctfs/ctf_info.html', { 'ctf' : ctf_info, 'solved_list': solved_list, 'alvalitated': flagged, 'description': description, 'date': timezone.now()})
diff --git a/src/events/templates/events/ctf_info.html b/src/events/templates/events/ctf_info.html
index 810440f..da5cba2 100644
--- a/src/events/templates/events/ctf_info.html
+++ b/src/events/templates/events/ctf_info.html
@@ -53,7 +53,7 @@
{% endif %}
diff --git a/src/events/views.py b/src/events/views.py
index df1c328..f3abe04 100644
--- a/src/events/views.py
+++ b/src/events/views.py
@@ -27,7 +27,7 @@ def events(request):
def chall_event_info(request, event_slug, chall_slug):
event_info = get_object_or_404(Event, slug=event_slug)
ctf_info = get_object_or_404(CTF, event__slug=event_info.slug, slug=chall_slug)
- if timezone.now() < ctf_info.start_date:
+ if timezone.now() < ctf_info.pub_date:
return redirect('events:event_info', event_slug=event_slug)
eventisover = False
alreadyflag = False