Skip to content

Commit

Permalink
Merge pull request #124 from uploadcare/u-widget-cdn-link
Browse files Browse the repository at this point in the history
Update CDN link to the widget
  • Loading branch information
Zmoki committed Jan 19, 2017
2 parents 0fb97d9 + bd8ff7f commit 21fa690
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ History
x.x.x
~~~~~

- Updated widget to version 2.10.2 (see `widget changelog`_).
- Update CDN link to the widget
- Use wildcard ``2.x`` to always get the latest
patch or minor version of the ``2`` major version of the widget,
see `widget changelog`_ now and then :)

2.1.0
~~~~~
Expand Down
4 changes: 2 additions & 2 deletions pyuploadcare/dj/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
conf.cdn_base = settings.UPLOADCARE['cdn_base']


widget_version = settings.UPLOADCARE.get('widget_version', '2.10.2')
widget_version = settings.UPLOADCARE.get('widget_version', '2.x')
widget_build = settings.UPLOADCARE.get(
'widget_build',
settings.UPLOADCARE.get('widget_variant', 'full.min'))

widget_filename = 'uploadcare.{0}.js'.format(widget_build).replace('..', '.')

hosted_url = (
'https://ucarecdn.com/widget/{version}/uploadcare/{filename}'
'https://ucarecdn.com/libs/widget/{version}/{filename}'
.format(version=widget_version, filename=widget_filename))

local_url = 'uploadcare/{filename}'.format(filename=widget_filename)
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SomeForm(forms.Form):
f = SomeForm(label_suffix='')
self.assertRegexpMatches(
str(f.media),
'https://ucarecdn\.com/widget/[\d\.x]+/uploadcare/uploadcare\.full.min\.js'
'https://ucarecdn\.com/libs/widget/[\d\.x]+/uploadcare\.full.min\.js'
)
self.assertIn('role="uploadcare-uploader"', str(f['ff']))
self.assertIn('data-public-key="asdf"', str(f['ff']))
Expand All @@ -48,7 +48,7 @@ class SomeForm(forms.Form):
f = SomeForm(label_suffix='')
self.assertRegexpMatches(
str(f.media),
'https://ucarecdn\.com/widget/[\d\.x]+/uploadcare/uploadcare\.full\.min\.js'
'https://ucarecdn\.com/libs/widget/[\d\.x]+/uploadcare\.full\.min\.js'
)
self.assertIn('role="role"', str(f['ff']))
self.assertIn('data-public-key="asdf"', str(f['ff']))
Expand Down

0 comments on commit 21fa690

Please sign in to comment.