Skip to content

Commit

Permalink
Fix the add_media() hack for Django 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vdboor committed Jan 18, 2018
1 parent e164026 commit 9d651a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion polymorphic/formsets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ def add_media(dest, media):
Only required for Django < 2.0
"""
if django.VERSION >= (2, 0):
dest += media
combined = dest + media
dest._css = combined._css
dest._js = combined._js
else:
dest.add_css(media._css)
dest.add_js(media._js)

0 comments on commit 9d651a1

Please sign in to comment.