[GH-ISSUE #953] Yet another weird traceback #811

Closed
opened 2026-02-27 11:13:40 +03:00 by kerem · 4 comments
Owner

Originally created by @gawel on GitHub (Oct 27, 2016).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/953

Received that in an error mail. Don't really know if it happen because of my instance history or because of a bug. What I'm sure is that it shouldn’t raise. Any advice ?

File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  149.                     response = self.process_exception_by_middleware(e, request)

File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  147.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/utils/decorators.py" in inner
  184.                     return func(*args, **kwargs)

File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  23.                 return view_func(request, *args, **kwargs)

File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  23.                 return view_func(request, *args, **kwargs)

File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/reversion/revisions.py" in do_revision_context
  315.                 return func(*args, **kwargs)

File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/modoboa/admin/views/identity.py" in editaccount
  185.     return AccountForm(request, instances=instances).process()

File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/modoboa/lib/form_utils.py" in process
  349.                 self.save()

File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/modoboa/admin/forms/account.py" in save
  512.             "AccountModified", self.instances["general"], self.account

File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/modoboa/lib/events.py" in raiseEvent
  90.         callback(*args, **kwargs)

File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/modoboa/limits/controls.py" in on_account_modified
  63.     if owner.role not in ["SuperAdmins", "Resellers"]:

Exception Type: AttributeError at /manager/admin/accounts/694/edit/
Exception Value: 'NoneType' object has no attribute 'role'
Originally created by @gawel on GitHub (Oct 27, 2016). Original GitHub issue: https://github.com/modoboa/modoboa/issues/953 Received that in an error mail. Don't really know if it happen because of my instance history or because of a bug. What I'm sure is that it shouldn’t raise. Any advice ? ``` File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 149. response = self.process_exception_by_middleware(e, request) File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 147. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/utils/decorators.py" in inner 184. return func(*args, **kwargs) File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view 23. return view_func(request, *args, **kwargs) File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view 23. return view_func(request, *args, **kwargs) File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/reversion/revisions.py" in do_revision_context 315. return func(*args, **kwargs) File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/modoboa/admin/views/identity.py" in editaccount 185. return AccountForm(request, instances=instances).process() File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/modoboa/lib/form_utils.py" in process 349. self.save() File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/modoboa/admin/forms/account.py" in save 512. "AccountModified", self.instances["general"], self.account File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/modoboa/lib/events.py" in raiseEvent 90. callback(*args, **kwargs) File "/var/www/modoboa/vtenv/local/lib/python2.7/site-packages/modoboa/limits/controls.py" in on_account_modified 63. if owner.role not in ["SuperAdmins", "Resellers"]: Exception Type: AttributeError at /manager/admin/accounts/694/edit/ Exception Value: 'NoneType' object has no attribute 'role' ```
kerem 2026-02-27 11:13:40 +03:00
  • closed this issue
  • added the
    duplicate
    label
Author
Owner

@tonioo commented on GitHub (Oct 27, 2016):

Looks similar to #937.

<!-- gh-comment-id:256704546 --> @tonioo commented on GitHub (Oct 27, 2016): Looks similar to #937.
Author
Owner

@gawel commented on GitHub (Oct 27, 2016):

Yep. But I'm using 1.6.1. Means that I've ghost objects without an owner ? I don't think we have deleted the superadmin. Can this occurs if a domain admin remove another domain admin ?

Maybe I can fix it by finding the best owner for ghost objects ? eg: user.owner = first domain admin found

<!-- gh-comment-id:256713318 --> @gawel commented on GitHub (Oct 27, 2016): Yep. But I'm using 1.6.1. Means that I've ghost objects without an owner ? I don't think we have deleted the superadmin. Can this occurs if a domain admin remove another domain admin ? Maybe I can fix it by finding the best owner for ghost objects ? eg: user.owner = first domain admin found
Author
Owner

@gawel commented on GitHub (Oct 27, 2016):

And btw, may be we can have a script to fix this kind of stuff ?

$ manage check-consistency --dry-run:  show known problems
$ manage check-consistency :  show and fix problems

For now it can handle non owned object. Maybe other problem in the future (hope not :) )

<!-- gh-comment-id:256714116 --> @gawel commented on GitHub (Oct 27, 2016): And btw, may be we can have a script to fix this kind of stuff ? ``` $ manage check-consistency --dry-run: show known problems $ manage check-consistency : show and fix problems ``` For now it can handle non owned object. Maybe other problem in the future (hope not :) )
Author
Owner

@tonioo commented on GitHub (Oct 28, 2016):

Domain admins should not be concerned by this issue... Anyway, such a command would be nice!

<!-- gh-comment-id:256853557 --> @tonioo commented on GitHub (Oct 28, 2016): Domain admins should not be concerned by this issue... Anyway, such a command would be nice!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#811
No description provided.