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

[fix] Separate version to avoid circular import #510

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tasks/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@
dest: "{{ openwisp2_path }}/openwisp2/celery.py"
group: "{{ www_group }}"
mode: 0640
tags: [django_init]

- name: Template version.py
notify: Reload application
template:
src: openwisp2/version.py
dest: "{{ openwisp2_path }}/openwisp2/version.py"
group: "{{ www_group }}"
mode: 0640
tags: [django_init]

- name: Template __init__.py
notify: Reload application
Expand Down
11 changes: 6 additions & 5 deletions templates/openwisp2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from .celery import app as celery_app
from .version import __openwisp_version__, __openwisp_installation_method__

__all__ = ['celery_app']
__openwisp_version__ = '24.11.1'
__openwisp_installation_method__ = (
'{{ openwisp2_installation_method | default("ansible-openwisp2") }}'
)
__all__ = [
'celery_app',
'__openwisp_version__',
'__openwisp_installation_method__'
]
4 changes: 4 additions & 0 deletions templates/openwisp2/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
__openwisp_version__ = '24.11.1'
__openwisp_installation_method__ = (
'{{ openwisp2_installation_method | default("ansible-openwisp2") }}'
)
Loading