epok-toolkit 1.12.2__py3-none-any.whl → 1.12.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of epok-toolkit might be problematic. Click here for more details.

@@ -39,17 +39,20 @@ class BaseOptimizedViewSet(viewsets.ModelViewSet):
39
39
  manager = model_cls._default_manager
40
40
 
41
41
  if hasattr(manager, 'simple') and self.action == 'list':
42
- log.debug("| LIBRERIA |Usando sin simple sin filtros")
42
+ log.debug("| LIBRERIA | Usando QS simple")
43
43
  qs = manager.simple()
44
44
  elif hasattr(manager, 'full'):
45
- log.debug("Usando sin full sin filtros")
45
+ log.debug("| LIBRERIA | Usando QS full")
46
46
  qs = manager.full()
47
47
 
48
- if hasattr(manager, 'created_by'):
49
- log.debug("| LIBRERIA |Filtrando por created_by")
48
+ try:
49
+ log.debug("| LIBRERIA | Filtrando por created_by")
50
50
  return qs.filter(created_by=self.request.user)
51
-
52
- return qs
51
+ except Exception as e:
52
+ log.error(f"| LIBRERIA | Error al filtrar por created_by: {e}")
53
+ log.info("| LIBRERIA | Filtrado sin created_by")
54
+ return qs
55
+
53
56
 
54
57
  def get_serializer_class(self):
55
58
 
@@ -67,11 +70,19 @@ class BaseOptimizedViewSet(viewsets.ModelViewSet):
67
70
 
68
71
 
69
72
  def perform_create(self, serializer):
70
- if hasattr(serializer, 'created_by') and hasattr(serializer, 'updated_by'):
73
+ try:
71
74
  log.debug("| LIBRERIA |Guardando con created_by y updated_by")
72
75
  serializer.save(created_by=self.request.user, updated_by=self.request.user)
76
+ except Exception as e:
77
+ log.error(f"| LIBRERIA | Error al guardar: {e}")
78
+ log.info("| LIBRERIA | Guardando sin created_by y updated_by")
79
+ serializer.save()
73
80
 
74
81
  def perform_update(self, serializer):
75
- if hasattr(serializer, 'updated_by'):
76
- log.debug("| LIBRERIA |Guardando con updated_by")
82
+ try:
83
+ log.debug("| LIBRERIA | Guardando con updated_by")
77
84
  serializer.save(updated_by=self.request.user)
85
+ except Exception as e:
86
+ log.error(f"| LIBRERIA | Error al actualizar: {e}")
87
+ log.info("| LIBRERIA | Guardando sin updated_by")
88
+ serializer.save()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: epok-toolkit
3
- Version: 1.12.2
3
+ Version: 1.12.3
4
4
  Summary: Una herramienta para la gestión de tareas y procesos en Django con Celery.
5
5
  Author-email: Fernando Leon Franco <fernanlee2131@gmail.com>
6
6
  License: MIT
@@ -7,7 +7,7 @@ epok_toolkit/django/fields.py,sha256=-ajP5qx-4bt9Qz9yW48gTlinTxD1xWPKOEkslqx8cSM
7
7
  epok_toolkit/django/manager.py,sha256=3MZcA9wQY4E1KD8XlgZQbzf4wlF9vA8Pntl_gKDWfpA,1350
8
8
  epok_toolkit/django/models.py,sha256=E1zj2KetRGszksQvLk3HN5kWkYkEYzJRRmAUOaLJmw8,1090
9
9
  epok_toolkit/django/response.py,sha256=O8OHBaKgUQjBeYLLbgTTs669l_4D6swUgAOwswjc-88,1716
10
- epok_toolkit/django/viewsets.py,sha256=0oAeepiQAL1hAqp73k0W11q6pJlvsS2aVQk3GfZ9sY0,2530
10
+ epok_toolkit/django/viewsets.py,sha256=xE1yxpjpWr8_gnBFYPg3mTX58U3H9_BYCi6YIiji6Hw,2934
11
11
  epok_toolkit/django/utils/__init__.py,sha256=zDuoqm_eksZQpL-Bvd_q2KGMtSXfprBjf4TScZiwV6k,25
12
12
  epok_toolkit/django/utils/magic_link.py,sha256=GiDuy0kAGdYohGPlBL7rwpKPMpXuB1wJa1k5LTAOm4w,889
13
13
  epok_toolkit/email/__init__.py,sha256=pyJwysyVoq6DuYAG72fulsKFoOuAfjw3aBH7FhmYGHc,35
@@ -25,8 +25,8 @@ epok_toolkit/pdf/fuentes/Kollektif-Italic.ttf,sha256=1CXPyw43il9u0tQ_7aRzsEaVtg3
25
25
  epok_toolkit/pdf/fuentes/Kollektif.ttf,sha256=7wTLkVVNUm1giLjIZcWRUH5r2r3o0GjdKic4V1A-pNQ,51128
26
26
  epok_toolkit/pdf/plantillas/Ticket_congrats.png,sha256=OSQhVR0j_nLHE6kSJ33BTR-77HM1fNAfJBe2EuX6wVk,157141
27
27
  epok_toolkit/pdf/plantillas/Ticket_congrats2.png,sha256=1RBogBdo-8WSMpD3H73HoLgJtr5EC5oVKfOCIWOxPSo,373605
28
- epok_toolkit-1.12.2.dist-info/licenses/LICENSE,sha256=iLDbGXdLSIOT5OsxzHCvtmxHtonE21GiFlS3LNkug4A,128
29
- epok_toolkit-1.12.2.dist-info/METADATA,sha256=DAEDs7wN_MotkSw9---npJdk6EyCPVKfBQs9c7ZBiw8,2217
30
- epok_toolkit-1.12.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
- epok_toolkit-1.12.2.dist-info/top_level.txt,sha256=Wo72AqIFcfWwBGM5F5iGFw9PrO3WBnTSprFZIJk_pNg,13
32
- epok_toolkit-1.12.2.dist-info/RECORD,,
28
+ epok_toolkit-1.12.3.dist-info/licenses/LICENSE,sha256=iLDbGXdLSIOT5OsxzHCvtmxHtonE21GiFlS3LNkug4A,128
29
+ epok_toolkit-1.12.3.dist-info/METADATA,sha256=zPnN9xWgY8kAlhmeBkx4pIkXNFJRSBoxaUqPoCBUMEo,2217
30
+ epok_toolkit-1.12.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
+ epok_toolkit-1.12.3.dist-info/top_level.txt,sha256=Wo72AqIFcfWwBGM5F5iGFw9PrO3WBnTSprFZIJk_pNg,13
32
+ epok_toolkit-1.12.3.dist-info/RECORD,,