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

include_moment(version=None) is broken #8

Closed
tom-d opened this issue Jun 20, 2014 · 3 comments
Closed

include_moment(version=None) is broken #8

tom-d opened this issue Jun 20, 2014 · 3 comments

Comments

@tom-d
Copy link

tom-d commented Jun 20, 2014

Hi,
I'm trying to serve moment-with-langs.min.js locally.
I presume this can be achieved with include_moment(version=None).
It appears to me the code forgets to set js when version is None.
My guess is the intent is...

if version is not None:
    js = "<script>...
js = js or ""
@tom-d
Copy link
Author

tom-d commented Jun 21, 2014

Sorry, I should of posted the stack trace.
Hope this clarifies the problem.
Cheers..

Traceback (most recent call last):
 ...
  File "/Users/td/client/lab-db/labdb/templates/base.html", line 149, in block "scripts"
    {{ moment.include_moment(None) }}
  File "/Users/td/client/lab-db/venv-2.6/lib/python2.6/site-packages/flask_moment.py", line 27, in include_moment
    </script>''' % js)

@miguelgrinberg
Copy link
Owner

I realized what the problem was after I replied. The bug is now fixed and I pushed a new release to PyPI.

@tom-d
Copy link
Author

tom-d commented Jun 23, 2014

Oops, my bad, my code suggestion is broken, should of been...

js = ""
if version is not None:
    js = "<script>...

Sorry about that.

miguelgrinberg added a commit that referenced this issue Jun 26, 2014
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

No branches or pull requests

2 participants