This repository was archived by the owner on Apr 29, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ def talk(request, talk_slug):
14
14
"""
15
15
Display Talk
16
16
"""
17
- talk = get_object_or_404 (Talk , slug = talk_slug )
17
+ current_conf = Conference .objects .current ().code
18
+ talk = get_object_or_404 (Talk , slug = talk_slug , conference = current_conf )
18
19
talk_as_dict = dump_relevant_talk_information_to_dict (talk )
19
20
20
21
can_update_talk = request .user .is_authenticated and can_user_update_talk (
Original file line number Diff line number Diff line change @@ -265,3 +265,17 @@ def test_view_slides_url_on_talk_detail_page(client):
265
265
response = client .get (url )
266
266
267
267
assert 'download/view slides' in response .content .decode ().lower ()
268
+
269
+
270
+ def test_talk_for_other_than_current_conference (client ):
271
+ """
272
+ Only display talks for the current conference.
273
+ """
274
+ get_default_conference ()
275
+ other_conference = get_default_conference (code = 'ep_other' )
276
+ talk_in_other_conference = TalkFactory (conference = other_conference .code )
277
+
278
+ url = reverse ("talks:talk" , args = [talk_in_other_conference .slug ])
279
+ resp = client .get (url )
280
+
281
+ assert resp .status_code == 404
You can’t perform that action at this time.
0 commit comments