haystack / murmur

A mailing list designed to reduce noise and encourage sharing
25 stars 13 forks source link

Successfully upgraded to django 1.11 #290

Closed raxelg closed 3 years ago

soyapark commented 3 years ago

When I try to create an account, I run into a following error image

Environment:

Request Method: POST
Request URL: http://localhost:8000/accounts/register/

Django Version: 1.11
Python Version: 2.7.17
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'http_handler',
 'schema',
 'browser',
 'smtp_handler',
 'gmail_setup',
 'registration',
 'storages')
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']

Traceback:

File "/usr/local/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python2.7/site-packages/django/views/generic/base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "/home/ubuntu/production/mailx/registration/views.py" in dispatch
  80.         return super(RegistrationView, self).dispatch(request, *args, **kwargs)

File "/usr/local/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "/home/ubuntu/production/mailx/registration/views.py" in post
  36.             return self.form_valid(request, form)

File "/home/ubuntu/production/mailx/registration/views.py" in form_valid
  83.         new_user = self.register(request, **form.cleaned_data)

File "/home/ubuntu/production/mailx/registration/backends/default/views.py" in register
  80.                                                                     password, site)

File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py" in inner
  185.                     return func(*args, **kwargs)

File "/home/ubuntu/production/mailx/registration/models.py" in create_inactive_user
  86.         new_user = User.objects.create_user(email, password)

File "/home/ubuntu/production/mailx/schema/models.py" in create_user
  251.      user.save(using=self._db)

File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/base_user.py" in save
  80.         super(AbstractBaseUser, self).save(*args, **kwargs)

File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py" in save
  806.                        force_update=force_update, update_fields=update_fields)

File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py" in save_base
  836.             updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)

File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py" in _save_table
  922.             result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)

File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py" in _do_insert
  961.                                using=using, raw=raw)

File "/usr/local/lib/python2.7/site-packages/django/db/models/manager.py" in manager_method
  85.                 return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py" in _insert
  1060.         return query.get_compiler(using=using).execute_sql(return_id)

File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
  1099.                 cursor.execute(sql, params)

File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
  80.             return super(CursorDebugWrapper, self).execute(sql, params)

File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute
  65.                 return self.cursor.execute(sql, params)

File "/usr/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py" in execute
  106.                 six.reraise(utils.IntegrityError, utils.IntegrityError(*tuple(e.args)), sys.exc_info()[2])

File "/usr/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py" in execute
  101.             return self.cursor.execute(query, args)

File "/usr/local/lib/python2.7/site-packages/MySQLdb/cursors.py" in execute
  209.         res = self._query(query)

File "/usr/local/lib/python2.7/site-packages/MySQLdb/cursors.py" in _query
  315.         db.query(q)

File "/usr/local/lib/python2.7/site-packages/MySQLdb/connections.py" in query
  239.         _mysql.connection.query(self, query)

Exception Type: IntegrityError at /accounts/register/
Exception Value: (1048, "Column 'last_login' cannot be null")
soyapark commented 3 years ago

Thanks for the update! Now I'm able to migrate to django 1.11 and see your new tag interface. I was testing the tag interface, and I was not able to add the tag. I got this error in web console:

create_post.js:109 Uncaught TypeError: Cannot read property 'click' of undefined
    at HTMLInputElement.<anonymous> (create_post.js:109)

Also, when I don't hit enter in the tag input, its content remains as a plain text and it gets attached in front of the subject line: image image

Maybe if the user did not hit the enter, maybe we should give warning to the user this tag won't be added?

raxelg commented 3 years ago

Thanks for the update! Now I'm able to migrate to django 1.11 and see your new tag interface. I was testing the tag interface, and I was not able to add the tag. I got this error in web console:

create_post.js:109 Uncaught TypeError: Cannot read property 'click' of undefined
    at HTMLInputElement.<anonymous> (create_post.js:109)

Also, when I don't hit enter in the tag input, its content remains as a plain text and it gets attached in front of the subject line: image image

Maybe if the user did not hit the enter, maybe we should give warning to the user this tag won't be added?

I believe this PR doesn't have the feature where you can use enter/tab keys to create new tags, so it would only work by adding the brackets (i.e. [tag]) in the tag input in this PR. As for not pressing enter, I agree we can tell the user to press enter or tab to create a new tag otherwise the tag will not be considered.

soyapark commented 3 years ago

closing this pr since it is getting really long to focus on changes for django 1.11. @raxelg for the future, please seperate different pr and not merge multiple prs