mirror of
https://github.com/dkmstr/openuds.git
synced 2025-02-02 09:47:13 +03:00
Fixed cache decorator for functions without arguments and fixed server registration certification validation to allow empty certificate
This commit is contained in:
parent
b0ffdb5492
commit
4c755f548e
@ -84,7 +84,8 @@ class ServerRegisterBase(Handler):
|
||||
validators.validate_fqdn(hostname)
|
||||
validators.validate_mac(mac)
|
||||
validators.validate_json(data)
|
||||
validators.validate_certificate(certificate)
|
||||
if certificate: # Emtpy certificate is allowed
|
||||
validators.validate_certificate(certificate)
|
||||
except Exception as e:
|
||||
raise rest_exceptions.RequestError(str(e)) from e
|
||||
|
||||
|
@ -247,7 +247,8 @@ def cached(
|
||||
# or if args[0] is an object, use its class name as cache name
|
||||
# or use the global 'functionCache' (generic, common cache, may clash with other functions)
|
||||
cache = inner_cache or Cache(
|
||||
getattr(getattr(args[0], '__class__', None), '__name__', None) or 'functionCache'
|
||||
(getattr(getattr(args[0], '__class__', None), '__name__', None) if len(args) > 0 else None)
|
||||
or 'functionCache'
|
||||
)
|
||||
|
||||
# if timeout is a function, call it
|
||||
|
Loading…
x
Reference in New Issue
Block a user