mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-13 13:29:23 +00:00
Mise à jour d'avril (#643)
This commit is contained in:
@ -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),
|
||||
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [("trombi", "0001_initial")]
|
||||
|
||||
operations = [
|
||||
|
@ -5,7 +5,6 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [("trombi", "0002_trombi_show_profiles")]
|
||||
|
||||
operations = [
|
||||
|
@ -6,7 +6,6 @@ import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [("trombi", "0003_trombicomment_is_moderated")]
|
||||
|
||||
operations = [
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user