Closed Bug 1189563 Opened 9 years ago Closed 9 years ago

Deletion of personas fails in logging code

Categories

(addons.mozilla.org Graveyard :: Developer Pages, defect)

defect
Not set
critical

Tracking

(Not tracked)

VERIFIED FIXED
2015-08

People

(Reporter: kmag, Assigned: magopian)

References

()

Details

Persona add-ons all have NULL `guid` fields. The logging code doesn't know how to handle None values. So, when we try to log the GUID of a deleted persona, it tries to treat it as a Model instance and throws.

Sentry URL:

http://sentry.mktmon.services.phx1.mozilla.com/mkt/addonsmozillaorg/group/18894/


Aggregate Details:

* First Seen: 5 hours ago
* Last Seen: 1 hour ago
* Number of tracebacks: undefined


Traceback:

Stacktrace (most recent call last):

  File "django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "amo/decorators.py", line 167, in wrapper
    return f(*args, **kw)
  File "amo/decorators.py", line 154, in __call__
    return self.f(*args, **kw)
  File "addons/decorators.py", line 43, in wrapper
    return f(request, addon, *args, **kw)
  File "amo/decorators.py", line 32, in wrapper
    return func(request, *args, **kw)
  File "devhub/decorators.py", line 40, in wrapper
    return fun()
  File "devhub/decorators.py", line 31, in fun
    return f(request, addon_id=addon.id, addon=addon, *args, **kw)
  File "amo/decorators.py", line 51, in wrapper
    return f(request, *args, **kw)
  File "devhub/views.py", line 349, in delete
    addon.delete(msg='Removed via devhub', reason=reason)
  File "django/db/transaction.py", line 431, in inner
    return func(*args, **kwargs)
  File "addons/models.py", line 499, in delete
    amo.log(amo.LOG.DELETE_ADDON, self.pk, self.guid, self)
  File "amo/log.py", line 646, in log
    al.arguments = args
  File "devhub/models.py", line 333, in arguments
    serialize_me.append(dict(((unicode(arg._meta), arg.pk),)))
Commits pushed to master at https://github.com/mozilla/olympia

https://github.com/mozilla/olympia/commit/bfc2f5e79365c108aa0013181227a7c3ebebba27
Personas don't have GUIDs, don't fail on (soft) deletion (bug 1189563)

https://github.com/mozilla/olympia/commit/7785452cfe6dd3ef58016813343f3fd8475bb653
Merge pull request #631 from magopian/1189563-dont-fail-on-persona-deletion

Personas don't have GUIDs, don't fail on (soft) deletion (bug 1189563)
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2015-08
STR: try deleting a persona, it should not fail, and it should be correctly logged (not sure where the log should display though, maybe in /en-US/admin/models/editors/eventlog/ ?)
I deleted a persona without any issues and I can see this in https://addons.allizom.org/en-US/admin/models/devhub/activitylog/ : http://screencast.com/t/gDJwE41P
Can I mark the bug as verified?
Flags: needinfo?(mathieu)
I think so, yes thanks!
Flags: needinfo?(mathieu)
Thanks, marking it as verified.
Status: RESOLVED → VERIFIED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.