google-code-export / django-hotclub

Automatically exported from code.google.com/p/django-hotclub
MIT License
0 stars 0 forks source link

Swaps gives TempleteRender error when creating a new offer #115

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a offer

Output is here
http://dpaste.com/91971/

The code is in models.py of swaps
def proposed_swap(self):
        if self.proposed_swaps:
            return self.proposed_swaps.all()[0]
        else:
            return None

What version of the product are you using? On what operating system?

Ubuntu 8.04 - Django trunk - Pinax trunk

If I remove the [0] it works perfectly

Original issue reported on code.google.com by boomro...@gmail.com on 19 Nov 2008 at 7:00

GoogleCodeExporter commented 9 years ago
This has been fixed!

Original comment by boomro...@gmail.com on 19 Nov 2008 at 3:37

GoogleCodeExporter commented 9 years ago
Was a stupid programmer error.

if self.proposed_swaps: 
should be
if self.proposed_swaps.all():

Method is supposed to return one proposed_swap if any exist.

I can't close issue.  Should have been posted to swaps home:
http://code.google.com/p/django-social-economics/

Original comment by bob.hau...@gmail.com on 19 Nov 2008 at 3:43

GoogleCodeExporter commented 9 years ago
Closing per request of Bob. Marking invalid due to it being an issue for an 
external app.

Original comment by bros...@gmail.com on 20 Nov 2008 at 5:25