mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
Do not rely on django yet.
This commit is contained in:
@@ -151,7 +151,10 @@ class DeployCommand(Command):
|
||||
|
||||
"""
|
||||
if "all" in extensions:
|
||||
official_exts = ModoAPIClient().list_extensions()
|
||||
# We hardcode the API url here to avoid a loading of
|
||||
# django's settings since they are not available yet...
|
||||
url = "http://api.modoboa.org/"
|
||||
official_exts = ModoAPIClient(url).list_extensions()
|
||||
extensions = [extension["name"] for extension in official_exts]
|
||||
|
||||
pip_args = ["install"] + extensions
|
||||
|
||||
@@ -6,8 +6,6 @@ import pkg_resources
|
||||
import requests
|
||||
from requests.exceptions import RequestException
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from versionfield.constants import DEFAULT_NUMBER_BITS
|
||||
from versionfield.version import Version
|
||||
|
||||
@@ -18,10 +16,11 @@ class ModoAPIClient(object):
|
||||
|
||||
def __init__(self, api_url=None):
|
||||
"""Constructor."""
|
||||
self._api_url = (
|
||||
settings.MODOBOA_API_URL if api_url is None
|
||||
else api_url
|
||||
)
|
||||
if api_url is None:
|
||||
from django.conf import settings
|
||||
self._api_url = settings.MODOBOA_API_URL
|
||||
else:
|
||||
self._api_url = api_url
|
||||
self._local_core_version = None
|
||||
self._latest_core_version = None
|
||||
self.changelog_url = None
|
||||
|
||||
Reference in New Issue
Block a user