From 29c447c23e6e93383b79b26bd9061ab336a0d51e Mon Sep 17 00:00:00 2001 From: Nachou-u Date: Wed, 9 Sep 2026 08:28:09 -0300 Subject: [PATCH] =?UTF-8?q?CORRECCI=C3=93N:=20arreglar=20excepciones=20sil?= =?UTF-8?q?enciosas=20y=20limpiar=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- expenses/forms.py | 11 +++++++---- patch_docker.py => scripts/patch_docker.py | 0 patch_html.py => scripts/patch_html.py | 0 patch_models.py => scripts/patch_models.py | 0 patch_settings.py => scripts/patch_settings.py | 0 patch_views.py => scripts/patch_views.py | 0 patch_whitenoise.py => scripts/patch_whitenoise.py | 0 seed_all.py => scripts/seed_all.py | 0 seed_categories.py => scripts/seed_categories.py | 0 seed_projects.py => scripts/seed_projects.py | 0 seed_specialties.py => scripts/seed_specialties.py | 0 11 files changed, 7 insertions(+), 4 deletions(-) rename patch_docker.py => scripts/patch_docker.py (100%) rename patch_html.py => scripts/patch_html.py (100%) rename patch_models.py => scripts/patch_models.py (100%) rename patch_settings.py => scripts/patch_settings.py (100%) rename patch_views.py => scripts/patch_views.py (100%) rename patch_whitenoise.py => scripts/patch_whitenoise.py (100%) rename seed_all.py => scripts/seed_all.py (100%) rename seed_categories.py => scripts/seed_categories.py (100%) rename seed_projects.py => scripts/seed_projects.py (100%) rename seed_specialties.py => scripts/seed_specialties.py (100%) diff --git a/expenses/forms.py b/expenses/forms.py index 76e3389..11c4c68 100644 --- a/expenses/forms.py +++ b/expenses/forms.py @@ -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." diff --git a/patch_docker.py b/scripts/patch_docker.py similarity index 100% rename from patch_docker.py rename to scripts/patch_docker.py diff --git a/patch_html.py b/scripts/patch_html.py similarity index 100% rename from patch_html.py rename to scripts/patch_html.py diff --git a/patch_models.py b/scripts/patch_models.py similarity index 100% rename from patch_models.py rename to scripts/patch_models.py diff --git a/patch_settings.py b/scripts/patch_settings.py similarity index 100% rename from patch_settings.py rename to scripts/patch_settings.py diff --git a/patch_views.py b/scripts/patch_views.py similarity index 100% rename from patch_views.py rename to scripts/patch_views.py diff --git a/patch_whitenoise.py b/scripts/patch_whitenoise.py similarity index 100% rename from patch_whitenoise.py rename to scripts/patch_whitenoise.py diff --git a/seed_all.py b/scripts/seed_all.py similarity index 100% rename from seed_all.py rename to scripts/seed_all.py diff --git a/seed_categories.py b/scripts/seed_categories.py similarity index 100% rename from seed_categories.py rename to scripts/seed_categories.py diff --git a/seed_projects.py b/scripts/seed_projects.py similarity index 100% rename from seed_projects.py rename to scripts/seed_projects.py diff --git a/seed_specialties.py b/scripts/seed_specialties.py similarity index 100% rename from seed_specialties.py rename to scripts/seed_specialties.py