CORRECCIÓN: arreglar excepciones silenciosas y limpiar scripts
This commit is contained in:
+7
-4
@@ -1,4 +1,7 @@
|
|||||||
from django import forms
|
from django import forms
|
||||||
|
import logging
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
from django.contrib.auth.models import User, Group
|
from django.contrib.auth.models import User, Group
|
||||||
from .models import (
|
from .models import (
|
||||||
Expense, Project, Category, SystemSetting, UserProfile, Document,
|
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_fuel_type'].initial = vlog.fuel_type
|
||||||
self.fields['v_route_origin'].initial = vlog.route_origin
|
self.fields['v_route_origin'].initial = vlog.route_origin
|
||||||
self.fields['v_route_destination'].initial = vlog.route_destination
|
self.fields['v_route_destination'].initial = vlog.route_destination
|
||||||
except Exception:
|
except Exception as e:
|
||||||
pass
|
logger.error(f"Error loading vehicle log initial data: {e}", exc_info=True)
|
||||||
|
|
||||||
def clean_amount_clp(self):
|
def clean_amount_clp(self):
|
||||||
data = self.cleaned_data.get('amount_clp', '')
|
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['rut'].initial = self.instance.profile.rut
|
||||||
self.fields['job_title'].initial = self.instance.profile.job_title
|
self.fields['job_title'].initial = self.instance.profile.job_title
|
||||||
self.fields['specialties'].initial = self.instance.profile.specialties.all()
|
self.fields['specialties'].initial = self.instance.profile.specialties.all()
|
||||||
except Exception:
|
except Exception as e:
|
||||||
pass
|
logger.error(f"Error setting initial profile fields: {e}", exc_info=True)
|
||||||
self.fields['password'].required = False
|
self.fields['password'].required = False
|
||||||
self.fields['password'].help_text = "Dejar en blanco si no desea cambiarla."
|
self.fields['password'].help_text = "Dejar en blanco si no desea cambiarla."
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user