ddanier / django-openx

Provides the necessary utilities to access the new OpenX-API
0 stars 0 forks source link

Adding or updating banners causes an infinite loop #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

   1. Instantiate a Banner object b
   2. Assign the necessary values to b.whatever
   3. Call b.add()

What is the expected output? What do you see instead?

   I expect the code to continue on.
   It does create the banner in the OpenX DB but the code hangs.

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

   Downloaded the version current in SVN as of Jan 18, 2010.
   Mac OS X.

Please provide any additional information below.

   I suspect that there is a coding error. Line 15 in banner.py:

        if 'aImage' in self:

   creates a loop. Python passes in a sequence of integers to Banner.__getitem__
   The call always returns None instead of an IndexError.

   (This same error occurs with the Banner.modify() method.)

As a matter of interest why are you deleting the aImage value from the data 
bucket? Is that just to free up the memory?

Original issue reported on code.google.com by supp...@emergentdiscovery.com on 18 Jan 2011 at 4:56

GoogleCodeExporter commented 9 years ago
Seems openx api 'get' didn't return 'aImage' array, so I think you could remove 
that code in your banner.py#16-17
#####################
if 'aImage' in self:
    del self['aImage']
#####################

Original comment by gzer...@gmail.com on 15 Aug 2011 at 9:18