Code shuffle.
This commit is contained in:
parent
4d24ab956f
commit
c7811ddd11
2 changed files with 18 additions and 17 deletions
|
@ -17,7 +17,23 @@ from django.db import connection
|
|||
from django.utils.encoding import iri_to_uri, uri_to_iri
|
||||
|
||||
from .models import Setting
|
||||
from .validators import GROUP_NT_DRIVE_LETTER, GROUP_NT_UNC
|
||||
|
||||
|
||||
GROUP_NT_UNC = r'file://[A-Za-z0-9!@#$%^&\'\)\(\.\-_{}~]+/'
|
||||
|
||||
GROUP_NT_DRIVE_LETTER = r'file:///[A-Za-z](?:\:|\|)/'
|
||||
|
||||
GROUP_NON_AUTH = r'file:///[A-Za-z0-9!@#$%^&\'\)\(\.\-_{}~]+'
|
||||
|
||||
FILE_IRI_PATTERN = (
|
||||
r'^(?P<unc>' +
|
||||
GROUP_NT_UNC +
|
||||
r')|(?P<driveletter>' +
|
||||
GROUP_NT_DRIVE_LETTER +
|
||||
r')|(?P<nonauth>' +
|
||||
GROUP_NON_AUTH +
|
||||
r')'
|
||||
)
|
||||
|
||||
|
||||
def generate_password(length=32):
|
||||
|
|
|
@ -8,22 +8,7 @@ from django.core import validators
|
|||
from django.core.exceptions import ValidationError
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
GROUP_NT_UNC = r'file://[A-Za-z0-9!@#$%^&\'\)\(\.\-_{}~]+/'
|
||||
|
||||
GROUP_NT_DRIVE_LETTER = r'file:///[A-Za-z](?:\:|\|)/'
|
||||
|
||||
GROUP_NON_AUTH = r'file:///[A-Za-z0-9!@#$%^&\'\)\(\.\-_{}~]+'
|
||||
|
||||
FILE_IRI_PATTERN = (
|
||||
r'^(?P<unc>' +
|
||||
GROUP_NT_UNC +
|
||||
r')|(?P<driveletter>' +
|
||||
GROUP_NT_DRIVE_LETTER +
|
||||
r')|(?P<nonauth>' +
|
||||
GROUP_NON_AUTH +
|
||||
r')'
|
||||
)
|
||||
from .utils import FILE_IRI_PATTERN
|
||||
|
||||
|
||||
class RadioIRIValidator(validators.URLValidator):
|
||||
|
|
Loading…
Reference in a new issue