django-orchestra-test/orchestra/contrib/saas/services/dokuwiki.py
Jorge Pastor 39eea70b79 inicio 2023/07/09
edited 2023/11/24 by pedro
2023-11-24 02:23:54 +01:00

25 lines
853 B
Python

from urllib.parse import urlparse
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
from .options import SoftwareService
from .. import settings
class DokuWikiService(SoftwareService):
name = 'dokuwiki'
verbose_name = "Dowkuwiki"
icon = 'orchestra/icons/apps/Dokuwiki.png'
site_domain = settings.SAAS_DOKUWIKI_DOMAIN
allow_custom_url = settings.SAAS_DOKUWIKI_ALLOW_CUSTOM_URL
def clean(self):
if self.allow_custom_url and self.instance.custom_url:
url = urlparse(self.instance.custom_url)
if url.path and url.path != '/':
raise ValidationError({
'custom_url': _("Support for specific URL paths (%s) is not implemented.") % url.path
})
super(DokuWikiService, self).clean()