Skip to content

Commit

Permalink
fix(#114): fix version issue
Browse files Browse the repository at this point in the history
closes #114
  • Loading branch information
Radi85 committed Dec 8, 2020
1 parent 6de6055 commit 1c2359e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.0
2.5.1
16 changes: 15 additions & 1 deletion comment/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import os

__version__ = '2.5.1'


def _get_version():
_parent_project_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand All @@ -12,5 +14,17 @@ def _get_version():
return version


__version__ = _get_version()
def check_release():
release = None
try:
release = _get_version()
except (FileNotFoundError, Exception):
pass
if release:
assert release == __version__, 'Current version does not match with manifest VERSION'


check_release()


default_app_config = 'comment.apps.CommentConfig'
4 changes: 2 additions & 2 deletions comment/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.views.decorators.cache import cache_page
from django.views.i18n import JavaScriptCatalog

from comment import _get_version
from comment import __version__
from comment.views import (
CreateComment, UpdateComment, DeleteComment, SetReaction, SetFlag, ChangeFlagState,
ConfirmComment)
Expand All @@ -22,6 +22,6 @@
# The value returned by _get_version() must change when translations change.
path(
'jsi18n/',
cache_page(86400, key_prefix='js18n-%s' % _get_version())(JavaScriptCatalog.as_view()),
cache_page(86400, key_prefix='js18n-%s' % __version__)(JavaScriptCatalog.as_view()),
name='javascript-catalog'),
]

0 comments on commit 1c2359e

Please sign in to comment.