Fixed bad payment method import
This commit is contained in:
parent
07ccd80934
commit
a58ebbd40a
|
@ -81,6 +81,7 @@ class DomainAdmin(AccountAdminMixin, ExtendedModelAdmin):
|
|||
|
||||
def display_is_top(self, domain):
|
||||
return domain.is_top
|
||||
display_is_top.short_description = _("Is top")
|
||||
display_is_top.boolean = True
|
||||
display_is_top.admin_order_field = 'top'
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from functools import partial
|
||||
|
||||
from django.db.models.loading import get_model
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
@ -70,6 +71,10 @@ class ServiceBackend(plugins.Plugin):
|
|||
def get_backend(cls, name):
|
||||
return cls.get_plugin(name)
|
||||
|
||||
@classmethod
|
||||
def model_class(cls):
|
||||
return get_model(cls.model)
|
||||
|
||||
def get_banner(self):
|
||||
time = timezone.now().strftime("%h %d, %Y %I:%M:%S")
|
||||
return "Generated by Orchestra at %s" % time
|
||||
|
|
|
@ -93,7 +93,7 @@ class Resource(models.Model):
|
|||
self.sync_periodic_task()
|
||||
# This only work on tests (multiprocessing used on real deployments)
|
||||
apps.get_app_config('resources').reload_relations()
|
||||
run('sleep 2 && touch %s/wsgi.py' % get_project_root(), async=True, display=True)
|
||||
run('sleep 2 && touch %s/wsgi.py' % get_project_root(), async=True)
|
||||
|
||||
def delete(self, *args, **kwargs):
|
||||
super(Resource, self).delete(*args, **kwargs)
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from celery import shared_task
|
||||
from django.db.models.loading import get_model
|
||||
|
||||
from orchestra.apps.orchestration.models import BackendOperation as Operation
|
||||
from orchestra.models.utils import get_model_field_path
|
||||
|
@ -16,7 +15,7 @@ def monitor(resource_id, ids=None):
|
|||
# Execute monitors
|
||||
for monitor_name in resource.monitors:
|
||||
backend = ServiceMonitor.get_backend(monitor_name)
|
||||
model = get_model(backend.model)
|
||||
model = backend.model_class()
|
||||
kwargs = {}
|
||||
if ids:
|
||||
path = get_model_field_path(model, resource_model)
|
||||
|
|
|
@ -113,7 +113,7 @@ def run(command, display=False, error_codes=[0], silent=False, stdin='', async=F
|
|||
if return_code not in error_codes:
|
||||
out.failed = True
|
||||
msg = "\nrun() encountered an error (return code %s) while executing '%s'\n"
|
||||
msg = msg % (p.returncode, command)
|
||||
msg = msg % (return_code, command)
|
||||
if display:
|
||||
sys.stderr.write("\n\033[1;31mCommandError: %s %s\033[m\n" % (msg, err))
|
||||
if not silent:
|
||||
|
|
Loading…
Reference in a new issue