Skip to content

Commit

Permalink
fix(event): remove override authentication to create event
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Sep 19, 2023
1 parent 07a75ad commit 16f38bc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
5 changes: 0 additions & 5 deletions lacommunaute/event/tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from lacommunaute.event.forms import EventModelForm
from lacommunaute.event.models import Event
from lacommunaute.users.factories import UserFactory
from lacommunaute.utils.templatetags.str_filters import inclusion_connect_url


faker = Faker()
Expand Down Expand Up @@ -234,8 +233,4 @@ class calendar_test(TestCase):
def test_template(self):
response = self.client.get(reverse("event:calendar"))
self.assertTemplateUsed(response, "event/event_calendar.html")
self.assertContains(response, inclusion_connect_url(reverse("event:create")))

self.client.force_login(UserFactory())
response = self.client.get(reverse("event:calendar"))
self.assertContains(response, reverse("event:create"))
2 changes: 1 addition & 1 deletion lacommunaute/event/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ def calendar_data(request):


def calendar(request):
return TemplateResponse(request, "event/event_calendar.html", {"next_url": reverse("event:create")})
return TemplateResponse(request, "event/event_calendar.html")
14 changes: 4 additions & 10 deletions lacommunaute/templates/event/event_calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,10 @@ <h1 class="s-title-01__title h1"><strong>Les évènements à venir</strong></h1>
<div class="s-section__container container">
<div class="s-section__row row">
<div class="s-section__col col-12">
{% if user.is_authenticated %}
<a href="{% url 'event:create' %}"
role="button" class="btn btn-primary">
{% trans "Post a new Public Event" %}
</a>
{% else %}
<a href="{% inclusion_connect_url next_url %}" rel="nofollow" class="btn btn-primary" data-bs-toggle="tooltip" data--bs-placement="top" title="Connectez-vous pour contribuer">
{% trans "Post a new Public Event" %}
</a>
{% endif %}
<a href="{% url 'event:create' %}" rel="nofollow"
role="button" class="btn btn-primary">
{% trans "Post a new Public Event" %}
</a>
</div>
</div>
</div>
Expand Down

0 comments on commit 16f38bc

Please sign in to comment.