[GH-ISSUE #533] Internal Server Error: /admin/accounts/new/ #506

Closed
opened 2026-02-27 11:12:07 +03:00 by kerem · 10 comments
Owner

Originally created by @mongos on GitHub (Mar 24, 2014).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/533

Hello,

Trying to add new account with domain admin:

Internal Server Error: /admin/accounts/new/
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 187, in get_response
response = middleware_method(request, response)
File "/usr/local/lib/python2.7/dist-packages/reversion/middleware.py", line 37, in process_response
self._close_revision(request)
File "/usr/local/lib/python2.7/dist-packages/reversion/middleware.py", line 28, in _close_revision
revision_context_manager.end()
File "/usr/local/lib/python2.7/dist-packages/reversion/revisions.py", line 182, in end
db = self._db,
File "/usr/local/lib/python2.7/dist-packages/reversion/revisions.py", line 483, in save_revision
versions = new_versions,
File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 170, in send
response = receiver(signal=self, sender=sender, **named)
File "/usr/local/lib/python2.7/dist-packages/modoboa/core/models.py", line 479, in post_revision_commit
prev_revisions = reversion.get_for_object(version.object)
File "/usr/local/lib/python2.7/dist-packages/reversion/revisions.py", line 518, in get_for_object
return self.get_for_object_reference(obj.class, obj.pk, db)
AttributeError: 'NoneType' object has no attribute 'pk'

Please help. Thank you in advance.

Originally created by @mongos on GitHub (Mar 24, 2014). Original GitHub issue: https://github.com/modoboa/modoboa/issues/533 Hello, Trying to add new account with domain admin: Internal Server Error: /admin/accounts/new/ Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 187, in get_response response = middleware_method(request, response) File "/usr/local/lib/python2.7/dist-packages/reversion/middleware.py", line 37, in process_response self._close_revision(request) File "/usr/local/lib/python2.7/dist-packages/reversion/middleware.py", line 28, in _close_revision revision_context_manager.end() File "/usr/local/lib/python2.7/dist-packages/reversion/revisions.py", line 182, in end db = self._db, File "/usr/local/lib/python2.7/dist-packages/reversion/revisions.py", line 483, in save_revision versions = new_versions, File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 170, in send response = receiver(signal=self, sender=sender, **named) File "/usr/local/lib/python2.7/dist-packages/modoboa/core/models.py", line 479, in post_revision_commit prev_revisions = reversion.get_for_object(version.object) File "/usr/local/lib/python2.7/dist-packages/reversion/revisions.py", line 518, in get_for_object return self.get_for_object_reference(obj.__class__, obj.pk, db) AttributeError: 'NoneType' object has no attribute 'pk' Please help. Thank you in advance.
kerem 2026-02-27 11:12:07 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@tonioo commented on GitHub (Mar 24, 2014):

Hello, which version are you using?

<!-- gh-comment-id:38430474 --> @tonioo commented on GitHub (Mar 24, 2014): Hello, which version are you using?
Author
Owner

@mongos commented on GitHub (Mar 24, 2014):

It is 1.1.1

<!-- gh-comment-id:38430592 --> @mongos commented on GitHub (Mar 24, 2014): It is 1.1.1
Author
Owner

@tonioo commented on GitHub (Mar 24, 2014):

I fail to reproduce your issue. What's your setup? (mysql or postgresl)

<!-- gh-comment-id:38436870 --> @tonioo commented on GitHub (Mar 24, 2014): I fail to reproduce your issue. What's your setup? (mysql or postgresl)
Author
Owner

@mongos commented on GitHub (Mar 24, 2014):

MySQL

<!-- gh-comment-id:38437130 --> @mongos commented on GitHub (Mar 24, 2014): MySQL
Author
Owner

@tonioo commented on GitHub (Mar 24, 2014):

Could you try with the code available in the 1.1.x branch ? (only contains bugfixes)

<!-- gh-comment-id:38437221 --> @tonioo commented on GitHub (Mar 24, 2014): Could you try with the code available in the 1.1.x branch ? (only contains bugfixes)
Author
Owner

@mongos commented on GitHub (Mar 24, 2014):

Now it say: "Mailboxes: limit reached"

<!-- gh-comment-id:38439132 --> @mongos commented on GitHub (Mar 24, 2014): Now it say: "Mailboxes: limit reached"
Author
Owner

@tonioo commented on GitHub (Mar 24, 2014):

Ok. As a super administrator, edit the domain admin and go to the "Resources" tab. I guess all limits are equal to 0. First solution is to define greater limits. Second solution is to disable the limits extension if you don't need it.

If you do need it then don't forget to define proper default values by going to Modoboa > Parameters > Limits.

<!-- gh-comment-id:38440245 --> @tonioo commented on GitHub (Mar 24, 2014): Ok. As a super administrator, edit the domain admin and go to the "Resources" tab. I guess all limits are equal to 0. First solution is to define greater limits. Second solution is to disable the limits extension if you don't need it. If you do need it then don't forget to define proper default values by going to Modoboa > Parameters > Limits.
Author
Owner

@mongos commented on GitHub (Mar 24, 2014):

Cool. Works now! Thanks.
Another report. Trying to add an account with cyrillic in First and Last name:

Internal Server Error: /admin/accounts/edit/30/
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 115, in get_response
response = callback(request, _callback_args, *_callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py", line 25, in _wrapped_view
return view_func(request, _args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py", line 25, in _wrapped_view
return view_func(request, _args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/transaction.py", line 223, in inner
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/reversion/revisions.py", line 300, in do_revision_context
return func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/modoboa-1.1.1-py2.7.egg/modoboa/extensions/admin/views/identity.py", line 189, in editaccount
form.save_general_form()
File "/usr/local/lib/python2.7/dist-packages/modoboa-1.1.1-py2.7.egg/modoboa/extensions/admin/forms/account.py", line 360, in save_general_form
self.account = self.forms[0]["instance"].save()
File "/usr/local/lib/python2.7/dist-packages/modoboa-1.1.1-py2.7.egg/modoboa/extensions/admin/forms/account.py", line 105, in save
account.save()
File "/usr/local/lib/python2.7/dist-packages/modoboa-1.1.1-py2.7.egg/modoboa/core/models.py", line 303, in save
super(User, self).save(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 546, in save
force_update=force_update, update_fields=update_fields)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 626, in save_base
rows = manager.using(using).filter(pk=pk_val)._update(values)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 605, in _update
return query.get_compiler(self.db).execute_sql(None)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 1020, in execute_sql
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 846, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 41, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 120, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 207, in execute
if not self._defer_warnings: self._warning_check()
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 117, in _warning_check
warn(w[-1], self.Warning, 3)
Warning: Incorrect string value: '\xD0\x90\xD1\x80\xD1\x82...' for column 'first_name' at row 1

Thank you in advance.

<!-- gh-comment-id:38443223 --> @mongos commented on GitHub (Mar 24, 2014): Cool. Works now! Thanks. Another report. Trying to add an account with cyrillic in First and Last name: Internal Server Error: /admin/accounts/edit/30/ Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 115, in get_response response = callback(request, _callback_args, *_callback_kwargs) File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py", line 25, in _wrapped_view return view_func(request, _args, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py", line 25, in _wrapped_view return view_func(request, _args, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/django/db/transaction.py", line 223, in inner return func(_args, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/reversion/revisions.py", line 300, in do_revision_context return func(_args, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/modoboa-1.1.1-py2.7.egg/modoboa/extensions/admin/views/identity.py", line 189, in editaccount form.save_general_form() File "/usr/local/lib/python2.7/dist-packages/modoboa-1.1.1-py2.7.egg/modoboa/extensions/admin/forms/account.py", line 360, in save_general_form self.account = self.forms[0]["instance"].save() File "/usr/local/lib/python2.7/dist-packages/modoboa-1.1.1-py2.7.egg/modoboa/extensions/admin/forms/account.py", line 105, in save account.save() File "/usr/local/lib/python2.7/dist-packages/modoboa-1.1.1-py2.7.egg/modoboa/core/models.py", line 303, in save super(User, self).save(_args, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 546, in save force_update=force_update, update_fields=update_fields) File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 626, in save_base rows = manager.using(using).filter(pk=pk_val)._update(values) File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 605, in _update return query.get_compiler(self.db).execute_sql(None) File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 1020, in execute_sql cursor = super(SQLUpdateCompiler, self).execute_sql(result_type) File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 846, in execute_sql cursor.execute(sql, params) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 41, in execute return self.cursor.execute(sql, params) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 120, in execute return self.cursor.execute(query, args) File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 207, in execute if not self._defer_warnings: self._warning_check() File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 117, in _warning_check warn(w[-1], self.Warning, 3) Warning: Incorrect string value: '\xD0\x90\xD1\x80\xD1\x82...' for column 'first_name' at row 1 Thank you in advance.
Author
Owner

@tonioo commented on GitHub (Mar 24, 2014):

What's your database collation?

<!-- gh-comment-id:38489201 --> @tonioo commented on GitHub (Mar 24, 2014): What's your database collation?
Author
Owner

@mongos commented on GitHub (Mar 24, 2014):

Heh. Forgot to change the default values. Thanks a lot!

<!-- gh-comment-id:38494379 --> @mongos commented on GitHub (Mar 24, 2014): Heh. Forgot to change the default values. Thanks a lot!
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#506
No description provided.