Broken IF statement

joboppsgpp at gmail.com joboppsgpp at gmail.com
Tue Jan 13 09:29:11 EST 2015


On Tuesday, January 13, 2015 at 4:57:50 AM UTC-5, Maxime S wrote:
> 2015-01-12 22:19 GMT+01:00 <jobop... at gmail.com>:
> >
> > https://bpaste.net/show/93be9e15634b <--- Line 19 through 22
> >
> > At all times, my program is assigning the object priority of 0, even if one already exists in the database with a priority of 0 (it's supposed to be assigning it a priority of 1 in those cases).
> >
> > I'm a non developer trying to fix a freelancer's code. Would anybody be able to suggest changes to the IF logic that might be able to fix it, assuming the statements in the code provided look flawed?
> >
> > Thanks...
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> 
> 
> This line:
> 
> obj, created = SocialAccount.objects.get_or_create(...)
> 
> suggest you are using Django. If it is the case you have to add obj.save() after changing the priority to send the new value to the DB.
> 
> Best,
> 
> Maxime

Thanks Maxime. I'll try that as well.



More information about the Python-list mailing list