coati-payroll 0.0.10__py3-none-any.whl → 0.0.12__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 coati-payroll might be problematic. Click here for more details.

coati_payroll/__init__.py CHANGED
@@ -177,7 +177,7 @@ def create_app(config) -> Flask:
177
177
  except Exception:
178
178
  log.trace("create_app: could not read SQLALCHEMY_DATABASE_URI from app.config")
179
179
 
180
- # Asegurar la creación de las tablas básicas al iniciar la app.
180
+ # Garantizar que las tablas básicas, el usuario admin y la configuración inicial existan
181
181
  try:
182
182
  log.trace("create_app: calling ensure_database_initialized")
183
183
  ensure_database_initialized(app)
@@ -188,7 +188,7 @@ def create_app(config) -> Flask:
188
188
  log.exception("create_app: ensure_database_initialized exception")
189
189
  except Exception:
190
190
  pass
191
- # No interrumpir el arranque si la inicialización automática falla.
191
+ # No detener el arranque si la inicialización automática falla
192
192
  pass
193
193
 
194
194
  try:
@@ -243,30 +243,6 @@ def create_app(config) -> Flask:
243
243
 
244
244
  limiter = configure_rate_limiting(app)
245
245
 
246
- # Load initial data and demo data after Babel is initialized
247
- # This allows translations to work properly
248
- # Skip loading in test environments to keep test databases clean
249
- if not app.config.get("TESTING"):
250
- with app.app_context():
251
- # Load initial data (currencies, income concepts, deduction concepts)
252
- # Strings are translated automatically based on the configured language
253
- try:
254
- from coati_payroll.initial_data import load_initial_data
255
-
256
- load_initial_data()
257
- except Exception as exc:
258
- log.trace(f"Could not load initial data: {exc}")
259
-
260
- # Load demo data if COATI_LOAD_DEMO_DATA environment variable is set
261
- # This provides comprehensive sample data for manual testing
262
- if environ.get("COATI_LOAD_DEMO_DATA"):
263
- try:
264
- from coati_payroll.demo_data import load_demo_data
265
-
266
- load_demo_data()
267
- except Exception as exc:
268
- log.trace(f"Could not load demo data: {exc}")
269
-
270
246
  app.register_blueprint(auth, url_prefix="/auth")
271
247
  app.register_blueprint(app_blueprint, url_prefix="/")
272
248
 
@@ -390,13 +366,17 @@ def ensure_database_initialized(app: Flask | None = None) -> None:
390
366
  _db.create_all()
391
367
  log.trace("ensure_database_initialized: create_all() completed")
392
368
  except Exception as exc:
393
- # Registrar excepción completa para diagnóstico
394
- log.trace(f"ensure_database_initialized: create_all() raised: {exc}")
395
- try:
396
- log.exception("ensure_database_initialized: create_all() exception")
397
- except Exception:
398
- pass
399
- # Re-raise? No — dejar que el llamador decida; aquí se registra la traza.
369
+ from sqlalchemy.exc import OperationalError
370
+
371
+ msg = str(exc).lower()
372
+ if isinstance(exc, OperationalError) and "already exists" in msg:
373
+ log.trace("ensure_database_initialized: create_all skipped existing objects")
374
+ else:
375
+ log.trace(f"ensure_database_initialized: create_all() raised: {exc}")
376
+ try:
377
+ log.exception("ensure_database_initialized: create_all() exception")
378
+ except Exception:
379
+ pass
400
380
 
401
381
  # Comprobar existencia de al menos un admin.
402
382
  registro_admin = _db.session.execute(_db.select(Usuario).filter_by(tipo="admin")).scalar_one_or_none()
coati_payroll/log.py CHANGED
@@ -62,7 +62,7 @@ custom_levels = {
62
62
  numeric_level = custom_levels.get(log_level_str, logging.INFO)
63
63
 
64
64
  # Configurar logger raíz
65
- root_logger = logging.getLogger("now_lms")
65
+ root_logger = logging.getLogger("coati_payroll")
66
66
  root_logger.setLevel(numeric_level)
67
67
 
68
68
  # Handler solo para stdout
coati_payroll/version.py CHANGED
@@ -15,4 +15,4 @@
15
15
  Canonical version of coati_payroll.
16
16
  """
17
17
 
18
- __version__ = "0.0.10"
18
+ __version__ = "0.0.12"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: coati-payroll
3
- Version: 0.0.10
3
+ Version: 0.0.12
4
4
  Summary: A jurisdiction-agnostic payroll calculation engine.
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -1,4 +1,4 @@
1
- coati_payroll/__init__.py,sha256=XLgl3-49tFRB1L6IWMGpuTGrpmor2NorLAiCcWBlK7w,17179
1
+ coati_payroll/__init__.py,sha256=sq6mEPCWCH3W6-kfrcrX04TpMhNzePace0sz-_lMgUg,16258
2
2
  coati_payroll/app.py,sha256=PPn5U2ViKU8yRiP0OMPkozq4CRWxp9Un27R_jAAkQ_g,3502
3
3
  coati_payroll/audit_helpers.py,sha256=0BDspyO5eQLRrdUCUcu5xe7F--2a-8OOAcejLJ4CcAg,27556
4
4
  coati_payroll/auth.py,sha256=v8yzxQnDZy3kbJnt9MWikyDJNwgCSkZpvfwARUnDh4s,4436
@@ -12,7 +12,7 @@ coati_payroll/i18n.py,sha256=d5tMFKz_CII3EaaFhCBaMr0chi7UqdhibEOlp2GvU2k,1996
12
12
  coati_payroll/initial_data.py,sha256=qs7IIOJit5wZNc3JNPResSPhuPPEi_ohObSJ9UzMedw,22227
13
13
  coati_payroll/interes_engine.py,sha256=YIvIj2WIb6rqFxNOIpqYaqnT04Gn0Nq9YVkPyg5LiDw,15013
14
14
  coati_payroll/locale_config.py,sha256=j_p24MVrdVN58-XcplD5SziLFs99PTb1IOfU0quU35g,5457
15
- coati_payroll/log.py,sha256=SAD_X-yMuvYZPIx1FbvwdMCEeS9_aX71A6EIeD8dLX4,4439
15
+ coati_payroll/log.py,sha256=xbGSNLY4Xv3kCbLsvOnJwg0CRDEcCsaAIkR8Nw7alJQ,4445
16
16
  coati_payroll/model.py,sha256=CSjxdNNDyUn7z8R_zJvKkqTn4L4_rH0JurB150ayu08,111479
17
17
  coati_payroll/plugin_manager.py,sha256=unQQ98D7ECT0AWH0oZH-eL8YzezSAJMc4X76BqPKmSQ,5694
18
18
  coati_payroll/rate_limiting.py,sha256=jCrLdfjTRZa8ldY1W4Oc9E5bJgg9xj73zfgAegWK1KY,2918
@@ -23,7 +23,7 @@ coati_payroll/schema_validator.py,sha256=wa2X7VrXrEA6OzybycHdMD7smKqeF6Vp7oNSmV7
23
23
  coati_payroll/security.py,sha256=EYARqQI6llhfczpGamaaJdFF0fLBHn0-2dWcXy6kEO0,3040
24
24
  coati_payroll/system_reports.py,sha256=Py51zWa6oUHLqoYkqMXmdNcb7QxRlScDKnWaDhW7l-M,20405
25
25
  coati_payroll/vacation_service.py,sha256=iMgE7CcCfd5ytCWknyokFlphfYrnmAu6jtlPIPzgpHQ,17600
26
- coati_payroll/version.py,sha256=woAE2W4I24adU-iLRW57CeSO8SsZZKKhBdPrl2wMMlY,651
26
+ coati_payroll/version.py,sha256=0RhDzeKiCxAlSaw_Hi-BXesEu2uCdm2rDEPRZtnE3b4,651
27
27
  coati_payroll/formula_engine/__init__.py,sha256=Nixn2nFtOk6PGZpnXCwRLnb-Pid_lz6qPRIv7j2P3HM,2461
28
28
  coati_payroll/formula_engine/data_sources.py,sha256=_UapWZiyWUqADnafpcd8936Vpg3Av_R2wxbvUEEi9Dc,30785
29
29
  coati_payroll/formula_engine/engine.py,sha256=f3a7mM8ckiGtE6RMK9ByEZdsllSGUsBLi19WxreDYsE,8897
@@ -240,9 +240,9 @@ coati_payroll/vistas/planilla/services/novedad_service.py,sha256=MYxbiqVrwzBbBTX
240
240
  coati_payroll/vistas/planilla/services/planilla_service.py,sha256=xpqxD6XLdTMRJfbPhvpWSYW7P6IcHKZgW6Ahg7kthk4,1195
241
241
  coati_payroll/vistas/planilla/validators/__init__.py,sha256=K-WnUGZaMYX-2DcduB-yMssuxUlztMCQKuGfqK67Vsk,754
242
242
  coati_payroll/vistas/planilla/validators/planilla_validators.py,sha256=WH1cyY1D7XPSb3MupNszofT3-YvgqBfp8vFDpo8hDA8,1680
243
- coati_payroll-0.0.10.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
244
- coati_payroll-0.0.10.dist-info/METADATA,sha256=CP1cA2idUzgCUWHyYLzF6lkQiCePysm3u1x_laJDdVw,22304
245
- coati_payroll-0.0.10.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
246
- coati_payroll-0.0.10.dist-info/entry_points.txt,sha256=GtZVGVYEFlpeSs7eHYh701VG7ftRRrZ54fsyFmbeZZc,54
247
- coati_payroll-0.0.10.dist-info/top_level.txt,sha256=wRaRlWHJnSoqktbTT1XJUkPNgKnR7VS75Ytyl8JJYPY,14
248
- coati_payroll-0.0.10.dist-info/RECORD,,
243
+ coati_payroll-0.0.12.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
244
+ coati_payroll-0.0.12.dist-info/METADATA,sha256=fwUVduhjz5FzBUYNmgZ0DohsUpYiP4-dINAO8pzpzho,22304
245
+ coati_payroll-0.0.12.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
246
+ coati_payroll-0.0.12.dist-info/entry_points.txt,sha256=GtZVGVYEFlpeSs7eHYh701VG7ftRRrZ54fsyFmbeZZc,54
247
+ coati_payroll-0.0.12.dist-info/top_level.txt,sha256=wRaRlWHJnSoqktbTT1XJUkPNgKnR7VS75Ytyl8JJYPY,14
248
+ coati_payroll-0.0.12.dist-info/RECORD,,