challenges_created #56

Merged
Starthur merged 2 commits from challenges_created into main 2022-05-27 16:56:57 +02:00
2 changed files with 18 additions and 5 deletions

View File

@ -75,6 +75,19 @@
</li> </li>
{% endfor %} {% endfor %}
</ul> </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>
</div> </div>

View File

@ -151,9 +151,9 @@ def profile(request, user_name):
for s in solves.reverse(): for s in solves.reverse():
somme += s.ctf.points somme += s.ctf.points
solved.append([s.flag_date.timestamp() * 1000,somme]) 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, 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 @login_required
def delete_account(request): def delete_account(request):