Closed Bug 797292 Opened 12 years ago Closed 12 years ago

'NoneType' object has no attribute 'pk'

Categories

(Marketplace Graveyard :: Code Quality, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2012-10-25

People

(Reporter: alexis+bugs, Assigned: alexis+bugs)

References

Details

I got a bunch of these "'NoneType' object has no attribute 'pk'" errors when running the test-suite. It seems that the reason is that the object creation needs the user to be passed in, which isn't the case. ====================================================================== ERROR: test_pay_methods (zamboni.mkt.lookup.tests.test_views.TestAppSummaryPurchases) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alexis/dev/github.com/zamboni/../zamboni/mkt/lookup/tests/test_views.py", line 518, in test_pay_methods type=amo.CONTRIB_PURCHASE) File "/home/alexis/.virtualenvs/zamboni/lib/python2.6/site-packages/django/db/models/manager.py", line 137, in create return self.get_query_set().create(**kwargs) File "/home/alexis/.virtualenvs/zamboni/lib/python2.6/site-packages/django/db/models/query.py", line 377, in create obj.save(force_insert=True, using=self.db) File "/home/alexis/.virtualenvs/zamboni/lib/python2.6/site-packages/django/db/models/base.py", line 463, in save self.save_base(using=using, force_insert=force_insert, force_update=force_update) File "/home/alexis/.virtualenvs/zamboni/lib/python2.6/site-packages/django/db/models/base.py", line 565, in save_base created=(not record_exists), raw=raw, using=using) File "/home/alexis/dev/github.com/zamboni/lib/misc/safe_signals.py", line 33, in safe_send response = receiver(signal=self, sender=sender, **named) File "/home/alexis/dev/github.com/zamboni/apps/market/models.py", line 156, in create_addon_purchase instance.addon.pk, instance.user.pk)) AttributeError: 'NoneType' object has no attribute 'pk' ----------------------------------------------------------------------
Assignee: nobody → alexis
Anything stopping a merge of this?
(In reply to Andy McKay [:andym] from comment #3) > Anything stopping a merge of this? Nope. Alexis - do you need help committing this? (Was there an official pull request?)
Target Milestone: --- → 2012-10-25
https://github.com/mozilla/zamboni/pull/462 is the right one. Closing the old one.
pull request is closed. closing the bug
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.