mirror of
https://github.com/dkmstr/openuds.git
synced 2025-03-20 06:50:23 +03:00
Merge remote-tracking branch 'origin/v4.0'
This commit is contained in:
commit
c758819c6b
@ -31,6 +31,7 @@
|
||||
Author: Alexander Burmatov, thatman at altlinux dot org
|
||||
"""
|
||||
import logging
|
||||
import re
|
||||
import typing
|
||||
|
||||
from django.utils.translation import gettext_lazy
|
||||
@ -155,7 +156,9 @@ class LinuxOsADManager(LinuxOsManager):
|
||||
raise exceptions.ui.ValidationError(_('Must provide an account to add machines to domain!'))
|
||||
if self.password.as_str() == '':
|
||||
raise exceptions.ui.ValidationError(_('Must provide a password for the account!'))
|
||||
self.ou.value = self.ou.value.strip()
|
||||
|
||||
# Remove spaces around , and = in ou
|
||||
self.ou.value = re.sub(r'\s*([,=])\s*', r'\1', self.ou.value.strip())
|
||||
|
||||
def actor_data(self, userservice: 'UserService') -> types.osmanagers.ActorData:
|
||||
return types.osmanagers.ActorData(
|
||||
|
@ -33,6 +33,7 @@ Author: Adolfo Gómez, dkmaster at dkmon dot com
|
||||
"""
|
||||
import codecs
|
||||
import logging
|
||||
import re
|
||||
import typing
|
||||
import collections.abc
|
||||
|
||||
@ -136,8 +137,11 @@ class WinDomainOsManager(WindowsOsManager):
|
||||
super().initialize(values)
|
||||
if values:
|
||||
# Some cleaning of input data (remove spaces, etc..)
|
||||
for fld in (self.domain, self.account, self.ou, self.grp, self.server_hint):
|
||||
for fld in (self.domain, self.account, self.grp, self.server_hint):
|
||||
fld.value = fld.value.strip().replace(' ', '')
|
||||
|
||||
# Remove spaces around , and = in ou
|
||||
self.ou.value = re.sub(r'\s*([,=])\s*', r'\1', self.ou.value.strip())
|
||||
|
||||
if self.domain.as_str() == '':
|
||||
raise exceptions.ui.ValidationError(_('Must provide a domain!'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user