fix a backward compatibility issue

This commit is contained in:
Élie Bouttier 2017-11-04 16:05:53 +01:00
parent c76ba3d6aa
commit abf5b43614
1 changed files with 5 additions and 5 deletions

View File

@ -359,8 +359,8 @@ def proposal_speaker_remove(request, speaker, talk_id, co_speaker_id):
# BACKWARD COMPATIBILITY
def talk_proposal(request, talk_id=None, participant_id=None):
if talk_id and participant_id:
talk = get_object_or_404(Talk, token=talk_id, site=site)
speaker = get_object_or_404(Participant, token=participant_id, site=site)
talk = get_object_or_404(Talk, token=talk_id, site=request.conference.site)
speaker = get_object_or_404(Participant, token=participant_id, site=request.conference.site)
return render(reverse('proposal-talk-edit', kwargs=dict(speaker_token=speaker.token, talk_id=talk.pk)))
else:
return render(reverse('proposal-home'))
@ -369,11 +369,11 @@ def talk_proposal(request, talk_id=None, participant_id=None):
# BACKWARD COMPATIBILITY
def talk_proposal_speaker_edit(request, talk_id, participant_id=None):
talk = get_object_or_404(Talk, token=talk_id, site=request.conference.site)
speaker = talk.speakers.first() # no other choice here…
if participant_id:
co_speaker = get_object_or_404(Participant, token=participant_id, site=request.conference.site)
return redirect(reverse('proposal-speaker-edit', kwargs=dict(speaker_token=speaker.token, talk_id=talk.pk, co_speaker_id=co_speaker.pk)))
speaker = get_object_or_404(Participant, token=participant_id, site=request.conference.site)
return redirect(reverse('proposal-profile-edit', kwargs=dict(speaker_token=speaker.token)))
else:
speaker = talk.speakers.first() # no other choice here…
return redirect(reverse('proposal-speaker-add', kwargs=dict(speaker_token=speaker.token, talk_id=talk.pk)))