Mise à jour d'avril (#643)

This commit is contained in:
Julien Constant
2023-05-10 11:56:33 +02:00
committed by GitHub
parent 910a6f8b34
commit 288764b551
201 changed files with 1746 additions and 1144 deletions

View File

@ -8,7 +8,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("club", "0007_auto_20170324_0917"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("trombi", "0001_initial")]
operations = [

View File

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("trombi", "0002_trombi_show_profiles")]
operations = [

View File

@ -6,7 +6,6 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("trombi", "0003_trombicomment_is_moderated")]
operations = [

View File

@ -14,8 +14,8 @@
<hr>
<h4>{% trans %}Add user{% endtrans %}</h4>
<form action="" method="post">
{% csrf_token %}
{{ form.as_p() }}
{% csrf_token %}
{{ form.as_p() }}
<input type="submit" value="{% trans %}Add{% endtrans %}" />
</form>
<hr>

View File

@ -38,18 +38,18 @@
</div>
<div>{{ u.user.get_display_name() }}</div>
{% if trombi.show_profiles %}
<div>
<a href="{{ url("trombi:user_profile", user_id=u.id) }}">{% trans %}Profile{% endtrans %}</a>
</div>
<div>
<a href="{{ url('trombi:user_profile', user_id=u.id) }}">{% trans %}Profile{% endtrans %}</a>
</div>
{% endif %}
<div>
{% if can_comment %}
{% set comment = u.received_comments.filter(author__id=user.trombi_user.id).first() %}
{% if comment %}
<a href="{{ url("trombi:edit_comment", comment_id=comment.id) }}">{% trans %}Edit comment{% endtrans %}</a>
{% else %}
<a href="{{ url("trombi:new_comment", user_id=u.id) }}">{% trans %}Comment{% endtrans %}</a>
{% endif %}
{% set comment = u.received_comments.filter(author__id=user.trombi_user.id).first() %}
{% if comment %}
<a href="{{ url('trombi:edit_comment', comment_id=comment.id) }}">{% trans %}Edit comment{% endtrans %}</a>
{% else %}
<a href="{{ url('trombi:new_comment', user_id=u.id) }}">{% trans %}Comment{% endtrans %}</a>
{% endif %}
{% endif %}
</div>
</div>

View File

@ -100,7 +100,6 @@ class UserIsInATrombiMixin(View):
"""
def dispatch(self, request, *args, **kwargs):
if not hasattr(self.request.user, "trombi_user"):
raise Http404()
@ -463,6 +462,10 @@ class UserTrombiProfileView(TrombiTabsMixin, DetailView):
def get(self, request, *args, **kwargs):
self.object = self.get_object()
if request.user.is_anonymous:
raise PermissionDenied()
if (
self.object.trombi.id != request.user.trombi_user.trombi.id
or self.object.user.id == request.user.id