fix(lint): resolver type narrowing, NoneType en auth y optimizar sync masivo de moodle en memoria

This commit is contained in:
2026-10-16 16:06:21 -03:00
parent fe5acb6119
commit cf368036a6
5 changed files with 46 additions and 34 deletions
+3 -2
View File
@@ -42,8 +42,9 @@ class AuditService:
# 2. Determinar IP de origen
if not ip_address and has_request_context():
if request.headers.get('X-Forwarded-For'):
ip_address = request.headers.get('X-Forwarded-For').split(',')[0].strip()
xfwd = request.headers.get('X-Forwarded-For')
if xfwd:
ip_address = xfwd.split(',')[0].strip()
else:
ip_address = request.remote_addr