Compare commits

...

5 Commits

Author SHA1 Message Date
Arthur
a3be2b6d54 cleanup 2026-02-06 10:35:18 -08:00
Arthur
97847662ac cleanup 2026-02-06 10:34:27 -08:00
Arthur
c23b656c26 cleanup 2026-02-06 10:33:05 -08:00
Arthur
6062aa71b1 Allow REDIS KWARGS to be set in configuration.py 2026-02-06 10:19:37 -08:00
Martin Hauser
ee6cbdcefe Fixes #21320: Prevent Rack validation errors when site or optional fields are missing during import (#21321) 2026-02-03 09:32:07 -06:00
3 changed files with 34 additions and 1 deletions

View File

@@ -373,7 +373,7 @@ class Rack(ContactsMixin, ImageAttachmentsMixin, TrackingModelMixin, RackBase):
super().clean()
# Validate location/site assignment
if self.site and self.location and self.location.site != self.site:
if self.site_id and self.location_id and self.location.site_id != self.site_id:
raise ValidationError(_("Assigned location must belong to parent site ({site}).").format(site=self.site))
# Validate outer dimensions and unit

View File

@@ -43,6 +43,16 @@ REDIS = {
# 'INSECURE_SKIP_TLS_VERIFY': False,
# Set a path to a certificate authority, typically used with a self signed certificate.
# 'CA_CERT_PATH': '/etc/ssl/certs/ca.crt',
# Advanced Redis client parameters (SSL/TLS, timeouts, etc.)
# Passed directly to redis-py. See: https://redis-py.readthedocs.io/en/stable/connections.html
# NOTE: The CA_CERT_PATH setting above is already mapped to 'ssl_ca_certs' in KWARGS.
# Only override these parameters in KWARGS if you have a specific reason to do so.
# 'KWARGS': {
# 'ssl_certfile': '/path/to/client-cert.pem',
# 'ssl_keyfile': '/path/to/client-key.pem',
# 'ssl_min_version': ssl.TLSVersion.TLSv1_2,
# 'ssl_ciphers': 'HIGH:!aNULL',
# },
},
'caching': {
'HOST': 'localhost',
@@ -59,6 +69,17 @@ REDIS = {
# 'INSECURE_SKIP_TLS_VERIFY': False,
# Set a path to a certificate authority, typically used with a self signed certificate.
# 'CA_CERT_PATH': '/etc/ssl/certs/ca.crt',
# Advanced Redis client parameters (SSL/TLS, timeouts, etc.)
# Passed directly to Redis connection pool. See: https://github.com/jazzband/django-redis#configure-as-cache-backend
# NOTE: The INSECURE_SKIP_TLS_VERIFY setting above is already mapped to 'ssl_cert_reqs' and
# CA_CERT_PATH is mapped to 'ssl_ca_certs' in KWARGS. Only override these parameters
# in KWARGS if you have a specific reason to do so.
# 'KWARGS': {
# 'ssl_certfile': '/path/to/client-cert.pem',
# 'ssl_keyfile': '/path/to/client-key.pem',
# 'ssl_min_version': ssl.TLSVersion.TLSv1_2,
# 'ssl_ciphers': 'HIGH:!aNULL',
# },
}
}

View File

@@ -408,6 +408,12 @@ if CACHING_REDIS_CA_CERT_PATH:
CACHES['default']['OPTIONS'].setdefault('CONNECTION_POOL_KWARGS', {})
CACHES['default']['OPTIONS']['CONNECTION_POOL_KWARGS']['ssl_ca_certs'] = CACHING_REDIS_CA_CERT_PATH
# Merge in KWARGS for additional parameters
caching_redis_kwargs = REDIS['caching'].get('KWARGS')
if caching_redis_kwargs:
CACHES['default']['OPTIONS'].setdefault('CONNECTION_POOL_KWARGS', {})
CACHES['default']['OPTIONS']['CONNECTION_POOL_KWARGS'].update(caching_redis_kwargs)
#
# Sessions
@@ -817,6 +823,12 @@ if TASKS_REDIS_CA_CERT_PATH:
RQ_PARAMS.setdefault('REDIS_CLIENT_KWARGS', {})
RQ_PARAMS['REDIS_CLIENT_KWARGS']['ssl_ca_certs'] = TASKS_REDIS_CA_CERT_PATH
# Merge in KWARGS for additional parameters
tasks_redis_kwargs = TASKS_REDIS.get('KWARGS')
if tasks_redis_kwargs:
RQ_PARAMS.setdefault('REDIS_CLIENT_KWARGS', {})
RQ_PARAMS['REDIS_CLIENT_KWARGS'].update(tasks_redis_kwargs)
# Define named RQ queues
RQ_QUEUES = {
RQ_QUEUE_HIGH: RQ_PARAMS,