No need for select_related on an actual object.

This commit is contained in:
Víðir Valberg Guðmundsson 2016-05-10 21:06:39 +02:00
parent c4a907890c
commit ce534cff55

View file

@ -77,9 +77,7 @@ class EpayView(TemplateView):
template_name = 'tickets/epay_form.html' template_name = 'tickets/epay_form.html'
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
ticket = Ticket.objects.get( ticket = Ticket.objects.get(pk=kwargs.get('ticket_id'))
pk=kwargs.get('ticket_id')
).select_related('ticket_type')
accept_url = ticket.get_absolute_url() accept_url = ticket.get_absolute_url()
amount = ticket.ticket_type.price * 100 amount = ticket.ticket_type.price * 100
order_id = str(ticket.pk) order_id = str(ticket.pk)