Skip to content

Conversation

@kidsdev
Copy link

@kidsdev kidsdev commented Dec 3, 2017

No description provided.

from suit.config import get_config

register = template.Library()
if django.VERSION >= (2, 0, 0, 'final', 0):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assignment_tag has been deprecated since 1.9.

Also, you can compare against a "coarse" version, not a very specific one. Makes it a little more readable.

if django.VERSION < (1, 9):
    simple_tag = register.assignment_tag
else:
    simple_tag = register.simple_tag

'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
if django.VERSION >= (2, 0, 0, 'final', 0):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new-style middleware can be used since 1.10.

Copy link
Contributor

@amureki amureki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kidsdev thank you for PR!
I would update travis configuration to be sure that tests are passing.

@grigi
Copy link

grigi commented Jan 10, 2018

I tested this, and it works for me. 👍
Thanks.


try:
from django.urls import reverse, resolve
except:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is far too broad, I suggest to narrow it to ImportError exception:

try:
    ...
except ImportError:
     ...

out_tpl = '<div class="datetime">%s</div>'
return mark_safe(out_tpl % html)

# def format_output(self, rendered_widgets):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants