Moved apps to contrib
This commit is contained in:
parent
1ff4e05819
commit
10d2f7f247
14
TODO.md
14
TODO.md
|
@ -282,13 +282,10 @@ from django.utils import translation
|
||||||
translation.activate('ca')
|
translation.activate('ca')
|
||||||
ugettext("Description")
|
ugettext("Description")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* saas validate_creation generic approach, for all backends. standard output
|
* saas validate_creation generic approach, for all backends. standard output
|
||||||
|
|
||||||
* html code x: × for bill line verbose quantity
|
* html code x: × for bill line verbose quantity
|
||||||
|
|
||||||
|
|
||||||
* periodic task to cleanup backendlogs, monitor data and metricstorage
|
* periodic task to cleanup backendlogs, monitor data and metricstorage
|
||||||
* create orchestrate databases.Database pk=1 -n --dry-run | --noinput --action save (default)|delete --backend name (limit to this backend) --help
|
* create orchestrate databases.Database pk=1 -n --dry-run | --noinput --action save (default)|delete --backend name (limit to this backend) --help
|
||||||
|
|
||||||
|
@ -301,12 +298,10 @@ celery max-tasks-per-child
|
||||||
|
|
||||||
* make base home for systemusers that ara homed into main account systemuser, and prevent shell users to have nested homes (if nnot implemented already)
|
* make base home for systemusers that ara homed into main account systemuser, and prevent shell users to have nested homes (if nnot implemented already)
|
||||||
|
|
||||||
|
|
||||||
* autoscale celery workers http://docs.celeryproject.org/en/latest/userguide/workers.html#autoscaling
|
* autoscale celery workers http://docs.celeryproject.org/en/latest/userguide/workers.html#autoscaling
|
||||||
|
|
||||||
* webapp has_website list filter
|
* webapp has_website list filter
|
||||||
|
|
||||||
|
|
||||||
glic3rinu's django-fluent-dashboard
|
glic3rinu's django-fluent-dashboard
|
||||||
* gevent is not ported to python3 :'(
|
* gevent is not ported to python3 :'(
|
||||||
* uwsgi python3
|
* uwsgi python3
|
||||||
|
@ -322,13 +317,6 @@ https://code.djangoproject.com/ticket/24576
|
||||||
* read https://docs.djangoproject.com/en/dev/releases/1.8/ and fix deprecation warnings
|
* read https://docs.djangoproject.com/en/dev/releases/1.8/ and fix deprecation warnings
|
||||||
* remove admin object links , like contents webapps
|
* remove admin object links , like contents webapps
|
||||||
|
|
||||||
* SaaS and WebApp fieldsets, and helptexts !
|
* SaaS and WebApp types and services fieldsets, and helptexts !
|
||||||
|
|
||||||
* remove all six stuff "from django.utils.six.moves import input"
|
|
||||||
* replace make_option in management commands
|
* replace make_option in management commands
|
||||||
|
|
||||||
|
|
||||||
* rename apps to contrib find . -type f -name "*py"|xargs grep apps | grep -v 'orchestra\.apps\.'
|
|
||||||
|
|
||||||
* replace staticcheck by run(flake8 {orchestra,project} | grep -v "W293\|E501")
|
|
||||||
* rename utils.system to utils.sys
|
|
||||||
|
|
|
@ -41,10 +41,10 @@ def get_services():
|
||||||
|
|
||||||
def get_accounts():
|
def get_accounts():
|
||||||
childrens=[]
|
childrens=[]
|
||||||
if isinstalled('orchestra.apps.payments'):
|
if isinstalled('orchestra.contrib.payments'):
|
||||||
url = reverse('admin:payments_transactionprocess_changelist')
|
url = reverse('admin:payments_transactionprocess_changelist')
|
||||||
childrens.append(items.MenuItem(_("Transaction processes"), url))
|
childrens.append(items.MenuItem(_("Transaction processes"), url))
|
||||||
if isinstalled('orchestra.apps.issues'):
|
if isinstalled('orchestra.contrib.issues'):
|
||||||
url = reverse('admin:issues_ticket_changelist')
|
url = reverse('admin:issues_ticket_changelist')
|
||||||
childrens.append(items.MenuItem(_("Tickets"), url))
|
childrens.append(items.MenuItem(_("Tickets"), url))
|
||||||
for model, options in accounts.get().items():
|
for model, options in accounts.get().items():
|
||||||
|
@ -59,12 +59,12 @@ def get_accounts():
|
||||||
|
|
||||||
def get_administration_items():
|
def get_administration_items():
|
||||||
childrens = []
|
childrens = []
|
||||||
if isinstalled('orchestra.apps.services'):
|
if isinstalled('orchestra.contrib.services'):
|
||||||
url = reverse('admin:services_service_changelist')
|
url = reverse('admin:services_service_changelist')
|
||||||
childrens.append(items.MenuItem(_("Services"), url))
|
childrens.append(items.MenuItem(_("Services"), url))
|
||||||
url = reverse('admin:plans_plan_changelist')
|
url = reverse('admin:plans_plan_changelist')
|
||||||
childrens.append(items.MenuItem(_("Plans"), url))
|
childrens.append(items.MenuItem(_("Plans"), url))
|
||||||
if isinstalled('orchestra.apps.orchestration'):
|
if isinstalled('orchestra.contrib.orchestration'):
|
||||||
route = reverse('admin:orchestration_route_changelist')
|
route = reverse('admin:orchestration_route_changelist')
|
||||||
backendlog = reverse('admin:orchestration_backendlog_changelist')
|
backendlog = reverse('admin:orchestration_backendlog_changelist')
|
||||||
server = reverse('admin:orchestration_server_changelist')
|
server = reverse('admin:orchestration_server_changelist')
|
||||||
|
@ -73,7 +73,7 @@ def get_administration_items():
|
||||||
items.MenuItem(_("Backend logs"), backendlog),
|
items.MenuItem(_("Backend logs"), backendlog),
|
||||||
items.MenuItem(_("Servers"), server),
|
items.MenuItem(_("Servers"), server),
|
||||||
]))
|
]))
|
||||||
if isinstalled('orchestra.apps.resources'):
|
if isinstalled('orchestra.contrib.resources'):
|
||||||
resource = reverse('admin:resources_resource_changelist')
|
resource = reverse('admin:resources_resource_changelist')
|
||||||
data = reverse('admin:resources_resourcedata_changelist')
|
data = reverse('admin:resources_resourcedata_changelist')
|
||||||
monitor = reverse('admin:resources_monitordata_changelist')
|
monitor = reverse('admin:resources_monitordata_changelist')
|
||||||
|
@ -82,10 +82,10 @@ def get_administration_items():
|
||||||
items.MenuItem(_("Data"), data),
|
items.MenuItem(_("Data"), data),
|
||||||
items.MenuItem(_("Monitoring"), monitor),
|
items.MenuItem(_("Monitoring"), monitor),
|
||||||
]))
|
]))
|
||||||
if isinstalled('orchestra.apps.miscellaneous'):
|
if isinstalled('orchestra.contrib.miscellaneous'):
|
||||||
url = reverse('admin:miscellaneous_miscservice_changelist')
|
url = reverse('admin:miscellaneous_miscservice_changelist')
|
||||||
childrens.append(items.MenuItem(_("Miscellaneous"), url))
|
childrens.append(items.MenuItem(_("Miscellaneous"), url))
|
||||||
if isinstalled('orchestra.apps.issues'):
|
if isinstalled('orchestra.contrib.issues'):
|
||||||
url = reverse('admin:issues_queue_changelist')
|
url = reverse('admin:issues_queue_changelist')
|
||||||
childrens.append(items.MenuItem(_("Ticket queues"), url))
|
childrens.append(items.MenuItem(_("Ticket queues"), url))
|
||||||
if isinstalled('djcelery'):
|
if isinstalled('djcelery'):
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
from .backends import ServiceMonitor
|
|
||||||
|
|
||||||
|
|
||||||
default_app_config = 'orchestra.apps.resources.apps.ResourcesConfig'
|
|
|
@ -36,7 +36,7 @@ MEDIA_URL = '/media/'
|
||||||
ALLOWED_HOSTS = '*'
|
ALLOWED_HOSTS = '*'
|
||||||
|
|
||||||
# Set this to True to wrap each HTTP request in a transaction on this database.
|
# Set this to True to wrap each HTTP request in a transaction on this database.
|
||||||
# ATOMIC REQUESTS do not wrap middlewares (orchestra.apps.orchestration.middlewares.OperationsMiddleware)
|
# ATOMIC REQUESTS do not wrap middlewares (orchestra.contrib.orchestration.middlewares.OperationsMiddleware)
|
||||||
ATOMIC_REQUESTS = False
|
ATOMIC_REQUESTS = False
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ MIDDLEWARE_CLASSES = (
|
||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
'orchestra.core.caches.RequestCacheMiddleware',
|
'orchestra.core.caches.RequestCacheMiddleware',
|
||||||
# also handles transations, ATOMIC_REQUESTS does not wrap middlewares
|
# also handles transations, ATOMIC_REQUESTS does not wrap middlewares
|
||||||
'orchestra.apps.orchestration.middlewares.OperationsMiddleware',
|
'orchestra.contrib.orchestration.middlewares.OperationsMiddleware',
|
||||||
# Uncomment the next line for simple clickjacking protection:
|
# Uncomment the next line for simple clickjacking protection:
|
||||||
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
)
|
)
|
||||||
|
@ -69,25 +69,25 @@ TEMPLATE_CONTEXT_PROCESSORS =(
|
||||||
INSTALLED_APPS = (
|
INSTALLED_APPS = (
|
||||||
# django-orchestra apps
|
# django-orchestra apps
|
||||||
'orchestra',
|
'orchestra',
|
||||||
'orchestra.apps.accounts',
|
'orchestra.contrib.accounts',
|
||||||
'orchestra.apps.contacts',
|
'orchestra.contrib.contacts',
|
||||||
'orchestra.apps.orchestration',
|
'orchestra.contrib.orchestration',
|
||||||
'orchestra.apps.domains',
|
'orchestra.contrib.domains',
|
||||||
'orchestra.apps.systemusers',
|
'orchestra.contrib.systemusers',
|
||||||
'orchestra.apps.mailboxes',
|
'orchestra.contrib.mailboxes',
|
||||||
'orchestra.apps.lists',
|
'orchestra.contrib.lists',
|
||||||
'orchestra.apps.webapps',
|
'orchestra.contrib.webapps',
|
||||||
'orchestra.apps.websites',
|
'orchestra.contrib.websites',
|
||||||
'orchestra.apps.databases',
|
'orchestra.contrib.databases',
|
||||||
'orchestra.apps.vps',
|
'orchestra.contrib.vps',
|
||||||
'orchestra.apps.saas',
|
'orchestra.contrib.saas',
|
||||||
'orchestra.apps.issues',
|
'orchestra.contrib.issues',
|
||||||
'orchestra.apps.services',
|
'orchestra.contrib.services',
|
||||||
'orchestra.apps.plans',
|
'orchestra.contrib.plans',
|
||||||
'orchestra.apps.orders',
|
'orchestra.contrib.orders',
|
||||||
'orchestra.apps.miscellaneous',
|
'orchestra.contrib.miscellaneous',
|
||||||
'orchestra.apps.bills',
|
'orchestra.contrib.bills',
|
||||||
'orchestra.apps.payments',
|
'orchestra.contrib.payments',
|
||||||
|
|
||||||
# Third-party apps
|
# Third-party apps
|
||||||
'django_extensions',
|
'django_extensions',
|
||||||
|
@ -111,7 +111,7 @@ INSTALLED_APPS = (
|
||||||
'django.contrib.admin.apps.SimpleAdminConfig',
|
'django.contrib.admin.apps.SimpleAdminConfig',
|
||||||
|
|
||||||
# Last to load
|
# Last to load
|
||||||
'orchestra.apps.resources',
|
'orchestra.contrib.resources',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -144,29 +144,29 @@ FLUENT_DASHBOARD_APP_GROUPS = (
|
||||||
# Services group is generated by orchestra.admin.dashboard
|
# Services group is generated by orchestra.admin.dashboard
|
||||||
('Accounts', {
|
('Accounts', {
|
||||||
'models': (
|
'models': (
|
||||||
'orchestra.apps.accounts.models.Account',
|
'orchestra.contrib.accounts.models.Account',
|
||||||
'orchestra.apps.contacts.models.Contact',
|
'orchestra.contrib.contacts.models.Contact',
|
||||||
'orchestra.apps.orders.models.Order',
|
'orchestra.contrib.orders.models.Order',
|
||||||
'orchestra.apps.plans.models.ContractedPlan',
|
'orchestra.contrib.plans.models.ContractedPlan',
|
||||||
'orchestra.apps.bills.models.Bill',
|
'orchestra.contrib.bills.models.Bill',
|
||||||
# 'orchestra.apps.payments.models.PaymentSource',
|
# 'orchestra.contrib.payments.models.PaymentSource',
|
||||||
'orchestra.apps.payments.models.Transaction',
|
'orchestra.contrib.payments.models.Transaction',
|
||||||
# 'orchestra.apps.payments.models.TransactionProcess',
|
# 'orchestra.contrib.payments.models.TransactionProcess',
|
||||||
'orchestra.apps.issues.models.Ticket',
|
'orchestra.contrib.issues.models.Ticket',
|
||||||
),
|
),
|
||||||
'collapsible': True,
|
'collapsible': True,
|
||||||
}),
|
}),
|
||||||
('Administration', {
|
('Administration', {
|
||||||
'models': (
|
'models': (
|
||||||
'djcelery.models.TaskState',
|
'djcelery.models.TaskState',
|
||||||
'orchestra.apps.orchestration.models.Route',
|
'orchestra.contrib.orchestration.models.Route',
|
||||||
'orchestra.apps.orchestration.models.BackendLog',
|
'orchestra.contrib.orchestration.models.BackendLog',
|
||||||
'orchestra.apps.orchestration.models.Server',
|
'orchestra.contrib.orchestration.models.Server',
|
||||||
'orchestra.apps.resources.models.Resource',
|
'orchestra.contrib.resources.models.Resource',
|
||||||
'orchestra.apps.resources.models.ResourceData',
|
'orchestra.contrib.resources.models.ResourceData',
|
||||||
'orchestra.apps.services.models.Service',
|
'orchestra.contrib.services.models.Service',
|
||||||
'orchestra.apps.plans.models.Plan',
|
'orchestra.contrib.plans.models.Plan',
|
||||||
'orchestra.apps.miscellaneous.models.MiscService',
|
'orchestra.contrib.miscellaneous.models.MiscService',
|
||||||
),
|
),
|
||||||
'collapsible': True,
|
'collapsible': True,
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import copy
|
import copy
|
||||||
import re
|
import re
|
||||||
|
from urllib.parse import parse_qsl
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.conf.urls import patterns, url
|
from django.conf.urls import patterns, url
|
||||||
|
@ -8,7 +9,6 @@ from django.contrib.admin.util import unquote
|
||||||
from django.contrib.auth import admin as auth
|
from django.contrib.auth import admin as auth
|
||||||
from django.http import HttpResponseRedirect
|
from django.http import HttpResponseRedirect
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
from django.utils.six.moves.urllib.parse import parse_qsl
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from orchestra.admin import ExtendedModelAdmin, ChangePasswordAdminMixin
|
from orchestra.admin import ExtendedModelAdmin, ChangePasswordAdminMixin
|
||||||
|
@ -80,11 +80,11 @@ class AccountAdmin(ChangePasswordAdminMixin, auth.UserAdmin, ExtendedModelAdmin)
|
||||||
messages.warning(request, 'This account is disabled.')
|
messages.warning(request, 'This account is disabled.')
|
||||||
context = {
|
context = {
|
||||||
'services': sorted(
|
'services': sorted(
|
||||||
[ model._meta for model in services.get() if model is not Account ],
|
[model._meta for model in services.get() if model is not Account],
|
||||||
key=lambda i: i.verbose_name_plural.lower()
|
key=lambda i: i.verbose_name_plural.lower()
|
||||||
),
|
),
|
||||||
'accounts': sorted(
|
'accounts': sorted(
|
||||||
[ model._meta for model in accounts.get() if model is not Account ],
|
[model._meta for model in accounts.get() if model is not Account],
|
||||||
key=lambda i: i.verbose_name_plural.lower()
|
key=lambda i: i.verbose_name_plural.lower()
|
||||||
)
|
)
|
||||||
}
|
}
|
|
@ -5,8 +5,8 @@ from django.db.models.loading import get_model
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from orchestra.apps.orchestration.middlewares import OperationsMiddleware
|
from orchestra.contrib.orchestration.middlewares import OperationsMiddleware
|
||||||
from orchestra.apps.orchestration.models import BackendOperation as Operation
|
from orchestra.contrib.orchestration.models import BackendOperation as Operation
|
||||||
from orchestra.core import services, accounts
|
from orchestra.core import services, accounts
|
||||||
from orchestra.utils import send_email_template
|
from orchestra.utils import send_email_template
|
||||||
|
|
||||||
|
@ -17,8 +17,9 @@ class Account(auth.AbstractBaseUser):
|
||||||
# Username max_length determined by LINUX system user lentgh: 32
|
# Username max_length determined by LINUX system user lentgh: 32
|
||||||
username = models.CharField(_("username"), max_length=32, unique=True,
|
username = models.CharField(_("username"), max_length=32, unique=True,
|
||||||
help_text=_("Required. 64 characters or fewer. Letters, digits and ./-/_ only."),
|
help_text=_("Required. 64 characters or fewer. Letters, digits and ./-/_ only."),
|
||||||
validators=[validators.RegexValidator(r'^[\w.-]+$',
|
validators=[
|
||||||
_("Enter a valid username."), 'invalid')])
|
validators.RegexValidator(r'^[\w.-]+$', _("Enter a valid username."), 'invalid')
|
||||||
|
])
|
||||||
main_systemuser = models.ForeignKey(settings.ACCOUNTS_SYSTEMUSER_MODEL, null=True,
|
main_systemuser = models.ForeignKey(settings.ACCOUNTS_SYSTEMUSER_MODEL, null=True,
|
||||||
related_name='accounts_main', editable=False)
|
related_name='accounts_main', editable=False)
|
||||||
short_name = models.CharField(_("short name"), max_length=64, blank=True)
|
short_name = models.CharField(_("short name"), max_length=64, blank=True)
|
|
@ -10,7 +10,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from orchestra.admin import ExtendedModelAdmin
|
from orchestra.admin import ExtendedModelAdmin
|
||||||
from orchestra.admin.utils import admin_date, insertattr
|
from orchestra.admin.utils import admin_date, insertattr
|
||||||
from orchestra.apps.accounts.admin import AccountAdminMixin, AccountAdmin
|
from orchestra.contrib.accounts.admin import AccountAdminMixin, AccountAdmin
|
||||||
from orchestra.forms.widgets import paddingCheckboxSelectMultiple
|
from orchestra.forms.widgets import paddingCheckboxSelectMultiple
|
||||||
|
|
||||||
from . import settings, actions
|
from . import settings, actions
|
|
@ -3,7 +3,7 @@ from rest_framework import viewsets
|
||||||
from rest_framework.decorators import detail_route
|
from rest_framework.decorators import detail_route
|
||||||
|
|
||||||
from orchestra.api import router
|
from orchestra.api import router
|
||||||
from orchestra.apps.accounts.api import AccountApiMixin
|
from orchestra.contrib.accounts.api import AccountApiMixin
|
||||||
from orchestra.utils.html import html_to_pdf
|
from orchestra.utils.html import html_to_pdf
|
||||||
|
|
||||||
from .models import Bill
|
from .models import Bill
|
|
@ -6,12 +6,10 @@ from orchestra.forms.widgets import ShowTextWidget
|
||||||
|
|
||||||
|
|
||||||
class SelectSourceForm(forms.ModelForm):
|
class SelectSourceForm(forms.ModelForm):
|
||||||
bill_link = forms.CharField(label=_("Number"), required=False,
|
bill_link = forms.CharField(label=_("Number"), required=False, widget=ShowTextWidget())
|
||||||
widget=ShowTextWidget())
|
|
||||||
account_link = forms.CharField(label=_("Account"), required=False)
|
account_link = forms.CharField(label=_("Account"), required=False)
|
||||||
display_total = forms.CharField(label=_("Total"), required=False)
|
display_total = forms.CharField(label=_("Total"), required=False)
|
||||||
display_type = forms.CharField(label=_("Type"), required=False,
|
display_type = forms.CharField(label=_("Type"), required=False, widget=ShowTextWidget())
|
||||||
widget=ShowTextWidget())
|
|
||||||
source = forms.ChoiceField(label=_("Source"), required=False)
|
source = forms.ChoiceField(label=_("Source"), required=False)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
|
@ -8,8 +8,8 @@ from django.utils.encoding import force_text
|
||||||
from django.utils.functional import cached_property
|
from django.utils.functional import cached_property
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from orchestra.apps.accounts.models import Account
|
from orchestra.contrib.accounts.models import Account
|
||||||
from orchestra.apps.contacts.models import Contact
|
from orchestra.contrib.contacts.models import Contact
|
||||||
from orchestra.core import accounts, validators
|
from orchestra.core import accounts, validators
|
||||||
from orchestra.utils.html import html_to_pdf
|
from orchestra.utils.html import html_to_pdf
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
||||||
from orchestra.api import router
|
from orchestra.api import router
|
||||||
from orchestra.apps.accounts.models import Account
|
from orchestra.contrib.accounts.models import Account
|
||||||
from orchestra.apps.accounts.serializers import AccountSerializerMixin
|
from orchestra.contrib.accounts.serializers import AccountSerializerMixin
|
||||||
|
|
||||||
from .models import Bill, BillLine, BillContact
|
from .models import Bill, BillLine, BillContact
|
||||||
|
|
|
@ -5,7 +5,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
from orchestra.admin import AtLeastOneRequiredInlineFormSet, ExtendedModelAdmin
|
from orchestra.admin import AtLeastOneRequiredInlineFormSet, ExtendedModelAdmin
|
||||||
from orchestra.admin.actions import SendEmail
|
from orchestra.admin.actions import SendEmail
|
||||||
from orchestra.admin.utils import insertattr, change_url
|
from orchestra.admin.utils import insertattr, change_url
|
||||||
from orchestra.apps.accounts.admin import AccountAdmin, AccountAdminMixin
|
from orchestra.contrib.accounts.admin import AccountAdmin, AccountAdminMixin
|
||||||
from orchestra.forms.widgets import paddingCheckboxSelectMultiple
|
from orchestra.forms.widgets import paddingCheckboxSelectMultiple
|
||||||
|
|
||||||
from .filters import EmailUsageListFilter
|
from .filters import EmailUsageListFilter
|
|
@ -1,7 +1,7 @@
|
||||||
from rest_framework import viewsets
|
from rest_framework import viewsets
|
||||||
|
|
||||||
from orchestra.api import router
|
from orchestra.api import router
|
||||||
from orchestra.apps.accounts.api import AccountApiMixin
|
from orchestra.contrib.accounts.api import AccountApiMixin
|
||||||
|
|
||||||
from .models import Contact
|
from .models import Contact
|
||||||
from .serializers import ContactSerializer
|
from .serializers import ContactSerializer
|
|
@ -49,8 +49,10 @@ class Contact(models.Model):
|
||||||
address = models.TextField(_("address"), blank=True)
|
address = models.TextField(_("address"), blank=True)
|
||||||
city = models.CharField(_("city"), max_length=128, blank=True)
|
city = models.CharField(_("city"), max_length=128, blank=True)
|
||||||
zipcode = models.CharField(_("zip code"), max_length=10, blank=True,
|
zipcode = models.CharField(_("zip code"), max_length=10, blank=True,
|
||||||
validators=[RegexValidator(r'^[0-9,A-Z]{3,10}$',
|
validators=[
|
||||||
_("Enter a valid zipcode."), 'invalid')])
|
RegexValidator(r'^[0-9,A-Z]{3,10}$',
|
||||||
|
_("Enter a valid zipcode."), 'invalid')
|
||||||
|
])
|
||||||
country = models.CharField(_("country"), max_length=20, blank=True,
|
country = models.CharField(_("country"), max_length=20, blank=True,
|
||||||
choices=settings.CONTACTS_COUNTRIES,
|
choices=settings.CONTACTS_COUNTRIES,
|
||||||
default=settings.CONTACTS_DEFAULT_COUNTRY)
|
default=settings.CONTACTS_DEFAULT_COUNTRY)
|
|
@ -1,7 +1,7 @@
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
||||||
from orchestra.api.serializers import MultiSelectField
|
from orchestra.api.serializers import MultiSelectField
|
||||||
from orchestra.apps.accounts.serializers import AccountSerializerMixin
|
from orchestra.contrib.accounts.serializers import AccountSerializerMixin
|
||||||
|
|
||||||
from .models import Contact
|
from .models import Contact
|
||||||
|
|
|
@ -5,7 +5,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from orchestra.admin import ExtendedModelAdmin, ChangePasswordAdminMixin
|
from orchestra.admin import ExtendedModelAdmin, ChangePasswordAdminMixin
|
||||||
from orchestra.admin.utils import change_url
|
from orchestra.admin.utils import change_url
|
||||||
from orchestra.apps.accounts.admin import SelectAccountAdminMixin
|
from orchestra.contrib.accounts.admin import SelectAccountAdminMixin
|
||||||
|
|
||||||
from .forms import DatabaseCreationForm, DatabaseUserChangeForm, DatabaseUserCreationForm
|
from .forms import DatabaseCreationForm, DatabaseUserChangeForm, DatabaseUserCreationForm
|
||||||
from .models import Database, DatabaseUser
|
from .models import Database, DatabaseUser
|
|
@ -1,7 +1,7 @@
|
||||||
from rest_framework import viewsets
|
from rest_framework import viewsets
|
||||||
|
|
||||||
from orchestra.api import router, SetPasswordApiMixin
|
from orchestra.api import router, SetPasswordApiMixin
|
||||||
from orchestra.apps.accounts.api import AccountApiMixin
|
from orchestra.contrib.accounts.api import AccountApiMixin
|
||||||
|
|
||||||
from .models import Database, DatabaseUser
|
from .models import Database, DatabaseUser
|
||||||
from .serializers import DatabaseSerializer, DatabaseUserSerializer
|
from .serializers import DatabaseSerializer, DatabaseUserSerializer
|
|
@ -2,8 +2,8 @@ import textwrap
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from orchestra.apps.orchestration import ServiceController
|
from orchestra.contrib.orchestration import ServiceController
|
||||||
from orchestra.apps.resources import ServiceMonitor
|
from orchestra.contrib.resources import ServiceMonitor
|
||||||
|
|
||||||
from . import settings
|
from . import settings
|
||||||
|
|
|
@ -4,7 +4,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
||||||
from orchestra.api.serializers import HyperlinkedModelSerializer
|
from orchestra.api.serializers import HyperlinkedModelSerializer
|
||||||
from orchestra.apps.accounts.serializers import AccountSerializerMixin
|
from orchestra.contrib.accounts.serializers import AccountSerializerMixin
|
||||||
from orchestra.core.validators import validate_password
|
from orchestra.core.validators import validate_password
|
||||||
|
|
||||||
from .models import Database, DatabaseUser
|
from .models import Database, DatabaseUser
|
|
@ -9,8 +9,8 @@ from django.core.urlresolvers import reverse
|
||||||
from selenium.webdriver.support.select import Select
|
from selenium.webdriver.support.select import Select
|
||||||
|
|
||||||
from orchestra.admin.utils import change_url
|
from orchestra.admin.utils import change_url
|
||||||
from orchestra.apps.orchestration.models import Server, Route
|
from orchestra.contrib.orchestration.models import Server, Route
|
||||||
from orchestra.utils.system import sshrun
|
from orchestra.utils.sys import sshrun
|
||||||
from orchestra.utils.tests import (BaseLiveServerTestCase, random_ascii, save_response_on_error,
|
from orchestra.utils.tests import (BaseLiveServerTestCase, random_ascii, save_response_on_error,
|
||||||
snapshot_on_error)
|
snapshot_on_error)
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ from ...models import Database, DatabaseUser
|
||||||
class DatabaseTestMixin(object):
|
class DatabaseTestMixin(object):
|
||||||
MASTER_SERVER = os.environ.get('ORCHESTRA_SECOND_SERVER', 'localhost')
|
MASTER_SERVER = os.environ.get('ORCHESTRA_SECOND_SERVER', 'localhost')
|
||||||
DEPENDENCIES = (
|
DEPENDENCIES = (
|
||||||
'orchestra.apps.orchestration',
|
'orchestra.contrib.orchestration',
|
||||||
'orcgestra.apps.databases',
|
'orcgestra.apps.databases',
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,7 +6,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from orchestra.admin import ExtendedModelAdmin
|
from orchestra.admin import ExtendedModelAdmin
|
||||||
from orchestra.admin.utils import admin_link, change_url
|
from orchestra.admin.utils import admin_link, change_url
|
||||||
from orchestra.apps.accounts.admin import AccountAdminMixin
|
from orchestra.contrib.accounts.admin import AccountAdminMixin
|
||||||
from orchestra.utils import apps
|
from orchestra.utils import apps
|
||||||
|
|
||||||
from .actions import view_zone
|
from .actions import view_zone
|
||||||
|
@ -86,7 +86,7 @@ class DomainAdmin(AccountAdminMixin, ExtendedModelAdmin):
|
||||||
display_is_top.admin_order_field = 'top'
|
display_is_top.admin_order_field = 'top'
|
||||||
|
|
||||||
def display_websites(self, domain):
|
def display_websites(self, domain):
|
||||||
if apps.isinstalled('orchestra.apps.websites'):
|
if apps.isinstalled('orchestra.contrib.websites'):
|
||||||
webs = domain.websites.all()
|
webs = domain.websites.all()
|
||||||
if webs:
|
if webs:
|
||||||
links = []
|
links = []
|
||||||
|
@ -111,7 +111,7 @@ class DomainAdmin(AccountAdminMixin, ExtendedModelAdmin):
|
||||||
'structured_name': 'CONCAT({table}.name, domains_domain.name)'.format(table=table)
|
'structured_name': 'CONCAT({table}.name, domains_domain.name)'.format(table=table)
|
||||||
},
|
},
|
||||||
).order_by('structured_name')
|
).order_by('structured_name')
|
||||||
if apps.isinstalled('orchestra.apps.websites'):
|
if apps.isinstalled('orchestra.contrib.websites'):
|
||||||
qs = qs.prefetch_related('websites')
|
qs = qs.prefetch_related('websites')
|
||||||
return qs
|
return qs
|
||||||
|
|
|
@ -3,7 +3,7 @@ from rest_framework.decorators import link
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
|
|
||||||
from orchestra.api import router
|
from orchestra.api import router
|
||||||
from orchestra.apps.accounts.api import AccountApiMixin
|
from orchestra.contrib.accounts.api import AccountApiMixin
|
||||||
|
|
||||||
from . import settings
|
from . import settings
|
||||||
from .models import Domain
|
from .models import Domain
|
|
@ -3,8 +3,8 @@ import textwrap
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from orchestra.apps.orchestration import ServiceController
|
from orchestra.contrib.orchestration import ServiceController
|
||||||
from orchestra.apps.orchestration.models import BackendOperation as Operation
|
from orchestra.contrib.orchestration.models import BackendOperation as Operation
|
||||||
|
|
||||||
from . import settings
|
from . import settings
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ class Bind9MasterDomainBackend(ServiceController):
|
||||||
|
|
||||||
def get_servers(self, domain, backend):
|
def get_servers(self, domain, backend):
|
||||||
""" Get related server IPs from registered backend routes """
|
""" Get related server IPs from registered backend routes """
|
||||||
from orchestra.apps.orchestration.manager import router
|
from orchestra.contrib.orchestration.manager import router
|
||||||
operation = Operation.create(backend, domain, Operation.SAVE)
|
operation = Operation.create(backend, domain, Operation.SAVE)
|
||||||
servers = []
|
servers = []
|
||||||
for server in router.get_servers(operation):
|
for server in router.get_servers(operation):
|
|
@ -3,7 +3,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
||||||
from orchestra.api.serializers import HyperlinkedModelSerializer
|
from orchestra.api.serializers import HyperlinkedModelSerializer
|
||||||
from orchestra.apps.accounts.serializers import AccountSerializerMixin
|
from orchestra.contrib.accounts.serializers import AccountSerializerMixin
|
||||||
|
|
||||||
from .helpers import domain_for_validation
|
from .helpers import domain_for_validation
|
||||||
from .models import Domain, Record
|
from .models import Domain, Record
|
|
@ -88,4 +88,5 @@ DOMAINS_FORBIDDEN = getattr(settings, 'DOMAINS_FORBIDDEN',
|
||||||
# unzip -p /tmp/top-1m.csv.zip | head -n 5000 | sed "s/^.*,//" > forbidden_domains.list
|
# unzip -p /tmp/top-1m.csv.zip | head -n 5000 | sed "s/^.*,//" > forbidden_domains.list
|
||||||
|
|
||||||
# '%(site_dir)s/forbidden_domains.list')
|
# '%(site_dir)s/forbidden_domains.list')
|
||||||
'')
|
''
|
||||||
|
)
|
|
@ -7,9 +7,9 @@ from django.conf import settings as djsettings
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from selenium.webdriver.support.select import Select
|
from selenium.webdriver.support.select import Select
|
||||||
|
|
||||||
from orchestra.apps.orchestration.models import Server, Route
|
from orchestra.contrib.orchestration.models import Server, Route
|
||||||
from orchestra.utils.tests import BaseLiveServerTestCase, random_ascii, snapshot_on_error, save_response_on_error
|
from orchestra.utils.tests import BaseLiveServerTestCase, random_ascii, snapshot_on_error, save_response_on_error
|
||||||
from orchestra.utils.system import run
|
from orchestra.utils.sys import run
|
||||||
|
|
||||||
from ... import settings, utils, backends
|
from ... import settings, utils, backends
|
||||||
from ...models import Domain, Record
|
from ...models import Domain, Record
|
||||||
|
@ -305,7 +305,7 @@ class RESTDomainMixin(DomainTestMixin):
|
||||||
|
|
||||||
class Bind9BackendMixin(object):
|
class Bind9BackendMixin(object):
|
||||||
DEPENDENCIES = (
|
DEPENDENCIES = (
|
||||||
'orchestra.apps.orchestration',
|
'orchestra.contrib.orchestration',
|
||||||
)
|
)
|
||||||
|
|
||||||
def add_route(self):
|
def add_route(self):
|
|
@ -6,7 +6,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from orchestra.core.validators import validate_hostname
|
from orchestra.core.validators import validate_hostname
|
||||||
from orchestra.utils import paths
|
from orchestra.utils import paths
|
||||||
from orchestra.utils.system import run
|
from orchestra.utils.sys import run
|
||||||
|
|
||||||
from . import settings
|
from . import settings
|
||||||
|
|
|
@ -11,7 +11,7 @@ from markdown import markdown
|
||||||
|
|
||||||
from orchestra.admin import ChangeListDefaultFilter, ExtendedModelAdmin#, ChangeViewActions
|
from orchestra.admin import ChangeListDefaultFilter, ExtendedModelAdmin#, ChangeViewActions
|
||||||
from orchestra.admin.utils import admin_link, admin_colored, wrap_admin_view, admin_date
|
from orchestra.admin.utils import admin_link, admin_colored, wrap_admin_view, admin_date
|
||||||
from orchestra.apps.contacts.models import Contact
|
from orchestra.contrib.contacts.models import Contact
|
||||||
|
|
||||||
from .actions import (reject_tickets, resolve_tickets, take_tickets, close_tickets,
|
from .actions import (reject_tickets, resolve_tickets, take_tickets, close_tickets,
|
||||||
mark_as_unread, mark_as_read, set_default_queue)
|
mark_as_unread, mark_as_read, set_default_queue)
|
|
@ -2,8 +2,8 @@ from django.conf import settings as djsettings
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from orchestra.apps.contacts import settings as contacts_settings
|
from orchestra.contrib.contacts import settings as contacts_settings
|
||||||
from orchestra.apps.contacts.models import Contact
|
from orchestra.contrib.contacts.models import Contact
|
||||||
from orchestra.core.translations import ModelTranslation
|
from orchestra.core.translations import ModelTranslation
|
||||||
from orchestra.models.fields import MultiSelectField
|
from orchestra.models.fields import MultiSelectField
|
||||||
from orchestra.utils import send_email_template
|
from orchestra.utils import send_email_template
|
||||||
|
@ -183,8 +183,7 @@ class Message(models.Model):
|
||||||
|
|
||||||
class TicketTracker(models.Model):
|
class TicketTracker(models.Model):
|
||||||
""" Keeps track of user read tickets """
|
""" Keeps track of user read tickets """
|
||||||
ticket = models.ForeignKey(Ticket, verbose_name=_("ticket"),
|
ticket = models.ForeignKey(Ticket, verbose_name=_("ticket"), related_name='trackers')
|
||||||
related_name='trackers')
|
|
||||||
user = models.ForeignKey(djsettings.AUTH_USER_MODEL, verbose_name=_("user"),
|
user = models.ForeignKey(djsettings.AUTH_USER_MODEL, verbose_name=_("user"),
|
||||||
related_name='ticket_trackers')
|
related_name='ticket_trackers')
|
||||||
|
|
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 204 B |
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 260 B |
|
@ -5,7 +5,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from orchestra.admin import ExtendedModelAdmin, ChangePasswordAdminMixin
|
from orchestra.admin import ExtendedModelAdmin, ChangePasswordAdminMixin
|
||||||
from orchestra.admin.utils import admin_link
|
from orchestra.admin.utils import admin_link
|
||||||
from orchestra.apps.accounts.admin import SelectAccountAdminMixin
|
from orchestra.contrib.accounts.admin import SelectAccountAdminMixin
|
||||||
|
|
||||||
from .forms import ListCreationForm, ListChangeForm
|
from .forms import ListCreationForm, ListChangeForm
|
||||||
from .models import List
|
from .models import List
|
|
@ -1,7 +1,7 @@
|
||||||
from rest_framework import viewsets
|
from rest_framework import viewsets
|
||||||
|
|
||||||
from orchestra.api import router, SetPasswordApiMixin
|
from orchestra.api import router, SetPasswordApiMixin
|
||||||
from orchestra.apps.accounts.api import AccountApiMixin
|
from orchestra.contrib.accounts.api import AccountApiMixin
|
||||||
|
|
||||||
from .models import List
|
from .models import List
|
||||||
from .serializers import ListSerializer
|
from .serializers import ListSerializer
|
|
@ -2,8 +2,8 @@ import textwrap
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from orchestra.apps.orchestration import ServiceController
|
from orchestra.contrib.orchestration import ServiceController
|
||||||
from orchestra.apps.resources import ServiceMonitor
|
from orchestra.contrib.resources import ServiceMonitor
|
||||||
|
|
||||||
from . import settings
|
from . import settings
|
||||||
from .models import List
|
from .models import List
|
|
@ -4,7 +4,7 @@ from django.shortcuts import get_object_or_404
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
||||||
from orchestra.api.serializers import HyperlinkedModelSerializer
|
from orchestra.api.serializers import HyperlinkedModelSerializer
|
||||||
from orchestra.apps.accounts.serializers import AccountSerializerMixin
|
from orchestra.contrib.accounts.serializers import AccountSerializerMixin
|
||||||
from orchestra.core.validators import validate_password
|
from orchestra.core.validators import validate_password
|
||||||
|
|
||||||
from .models import List
|
from .models import List
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue