mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Allow empty URLs
This commit is contained in:
parent
1e80e33634
commit
721d10a9ec
@ -34,6 +34,19 @@ import logging
|
||||
logger = logging.getLogger('inventree')
|
||||
|
||||
|
||||
class EmptyURLValidator(URLValidator):
|
||||
|
||||
def __call__(self, value):
|
||||
|
||||
value = str(value).strip()
|
||||
|
||||
if len(value) == 0:
|
||||
pass
|
||||
|
||||
else:
|
||||
super().__call__(value)
|
||||
|
||||
|
||||
class BaseInvenTreeSetting(models.Model):
|
||||
"""
|
||||
An base InvenTreeSetting object is a key:value pair used for storing
|
||||
@ -572,7 +585,7 @@ class InvenTreeSetting(BaseInvenTreeSetting):
|
||||
'INVENTREE_BASE_URL': {
|
||||
'name': _('Base URL'),
|
||||
'description': _('Base URL for server instance'),
|
||||
'validator': URLValidator(),
|
||||
'validator': EmptyURLValidator(),
|
||||
'default': '',
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user