CORRECCIÓN: arreglar excepciones silenciosas y limpiar scripts

This commit is contained in:
Nachou-u
2026-09-09 08:28:09 -03:00
parent 5d9e0f4589
commit 29c447c23e
11 changed files with 7 additions and 4 deletions
+7 -4
View File
@@ -1,4 +1,7 @@
from django import forms
import logging
logger = logging.getLogger(__name__)
from django.contrib.auth.models import User, Group
from .models import (
Expense, Project, Category, SystemSetting, UserProfile, Document,
@@ -144,8 +147,8 @@ class ExpenseForm(forms.ModelForm):
self.fields['v_fuel_type'].initial = vlog.fuel_type
self.fields['v_route_origin'].initial = vlog.route_origin
self.fields['v_route_destination'].initial = vlog.route_destination
except Exception:
pass
except Exception as e:
logger.error(f"Error loading vehicle log initial data: {e}", exc_info=True)
def clean_amount_clp(self):
data = self.cleaned_data.get('amount_clp', '')
@@ -432,8 +435,8 @@ class ResponsableForm(forms.Form):
self.fields['rut'].initial = self.instance.profile.rut
self.fields['job_title'].initial = self.instance.profile.job_title
self.fields['specialties'].initial = self.instance.profile.specialties.all()
except Exception:
pass
except Exception as e:
logger.error(f"Error setting initial profile fields: {e}", exc_info=True)
self.fields['password'].required = False
self.fields['password'].help_text = "Dejar en blanco si no desea cambiarla."