Merge pull request 'challenges_created' (#56) from challenges_created into main

Reviewed-on: #56
This commit is contained in:
Starthur 2022-05-27 16:56:57 +02:00
commit ebdc3b9c9e
2 changed files with 18 additions and 5 deletions

View File

@ -75,6 +75,19 @@
</li>
{% endfor %}
</ul>
<ul class="list-group">
<ul class="list-group">
<li class="list-group-item">{% trans "Challenges created" %}</li>
{% if created %}
{% for creat in created %}
<li class="list-group-item"><a href="{% url 'ctf' cat_slug=creat.category.slug ctf_slug=creat.slug %}">{{ creat.name }}</a></li>
{% endfor %}
{% else %}
<p>{% trans "It seems that this user has not created any challenge yet..." %}</p>
{% endif %}
</ul>
</ul>
</div>
</div>

View File

@ -151,9 +151,9 @@ def profile(request, user_name):
for s in solves.reverse():
somme += s.ctf.points
solved.append([s.flag_date.timestamp() * 1000,somme])
created = CTF.objects.filter(author=user_obj)
return render(request,'accounts/profile.html', {'user':user_obj, 'solves':solves,'solved':solved,'catsDatas': catsDatas, 'pointDatas': pointDatas,
'rank': rank, 'score' : somme, 'member' : member, 'cats':cats})
'rank': rank, 'score' : somme, 'member' : member, 'cats':cats, 'created':created})
@login_required
def delete_account(request):