Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error on django>=3.0 that occurs due to a removing python_2_unicode_compatible from the latest versions #484

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion jet/dashboard/models.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
from importlib import import_module
import json
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from jet.utils import LazyDateTimeEncoder

import sys

if sys.version_info.major == 2:
from django.utils.encoding import python_2_unicode_compatible
else:
python_2_unicode_compatible = lambda cls: cls


@python_2_unicode_compatible
class UserDashboardModule(models.Model):
Expand Down
7 changes: 6 additions & 1 deletion jet/models.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
import sys

if sys.version_info.major == 2:
from django.utils.encoding import python_2_unicode_compatible
else:
python_2_unicode_compatible = lambda cls: cls


@python_2_unicode_compatible
class Bookmark(models.Model):
url = models.URLField(verbose_name=_('URL'))
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def get_install_requires():
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Environment :: Web Environment',
'Topic :: Software Development',
'Topic :: Software Development :: User Interfaces',
Expand Down