coati-payroll 0.0.6__py3-none-any.whl → 0.0.8__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/cli.py CHANGED
@@ -76,15 +76,11 @@ class PluginsCommand(click.Group):
76
76
  return []
77
77
 
78
78
  def get_command(self, cli_ctx, name):
79
- try:
80
- module = load_plugin_module(name)
81
- except Exception as exc:
82
- message = str(exc)
83
-
84
- def _missing():
85
- raise click.ClickException(message)
86
-
87
- return click.Command(name, callback=lambda: _missing())
79
+ def _load_module_or_fail():
80
+ try:
81
+ return load_plugin_module(name)
82
+ except Exception as exc:
83
+ raise click.ClickException(str(exc))
88
84
 
89
85
  @click.group(name=name, help=f"Gestión del plugin '{name}'")
90
86
  def plugin_group():
@@ -95,6 +91,7 @@ class PluginsCommand(click.Group):
95
91
  @with_appcontext
96
92
  @pass_context
97
93
  def plugin_init(ctx):
94
+ module = _load_module_or_fail()
98
95
  init_fn = getattr(module, "init", None)
99
96
  if init_fn is None or not callable(init_fn):
100
97
  raise click.ClickException("Plugin does not provide callable 'init()'")
@@ -112,6 +109,7 @@ class PluginsCommand(click.Group):
112
109
  @with_appcontext
113
110
  @pass_context
114
111
  def plugin_update(ctx):
112
+ module = _load_module_or_fail()
115
113
  update_fn = getattr(module, "update", None)
116
114
  if update_fn is None or not callable(update_fn):
117
115
  raise click.ClickException("Plugin does not provide callable 'update()'")
@@ -131,6 +129,7 @@ class PluginsCommand(click.Group):
131
129
  def plugin_demo_data(ctx):
132
130
  """Carga datos de demostración para pruebas automáticas."""
133
131
  # Permitir alias: demo_data o load_demo_data
132
+ module = _load_module_or_fail()
134
133
  demo_fn = getattr(module, "demo_data", None)
135
134
  if demo_fn is None or not callable(demo_fn):
136
135
  demo_fn = getattr(module, "load_demo_data", None)
@@ -153,7 +152,15 @@ class PluginsCommand(click.Group):
153
152
  """Habilita el plugin en el registro (active=True)."""
154
153
  try:
155
154
  sync_plugin_registry()
156
- record = db.session.execute(db.select(PluginRegistry).filter_by(plugin_id=name)).scalars().first()
155
+ record = (
156
+ db.session.execute(
157
+ db.select(PluginRegistry).filter(
158
+ (PluginRegistry.plugin_id == name) | (PluginRegistry.distribution_name == name)
159
+ )
160
+ )
161
+ .scalars()
162
+ .first()
163
+ )
157
164
  if record is None:
158
165
  raise click.ClickException("Plugin no registrado en la base de datos")
159
166
  if not record.installed:
@@ -175,7 +182,15 @@ class PluginsCommand(click.Group):
175
182
  """Deshabilita el plugin en el registro (active=False)."""
176
183
  try:
177
184
  sync_plugin_registry()
178
- record = db.session.execute(db.select(PluginRegistry).filter_by(plugin_id=name)).scalars().first()
185
+ record = (
186
+ db.session.execute(
187
+ db.select(PluginRegistry).filter(
188
+ (PluginRegistry.plugin_id == name) | (PluginRegistry.distribution_name == name)
189
+ )
190
+ )
191
+ .scalars()
192
+ .first()
193
+ )
179
194
  if record is None:
180
195
  raise click.ClickException("Plugin no registrado en la base de datos")
181
196
  record.active = False
@@ -29,30 +29,33 @@
29
29
  <td>{{ plugin.version or '-' }}</td>
30
30
  <td>
31
31
  {% if plugin.installed %}
32
- <span class="badge bg-success">{{ _('Sí') }}</span>
32
+ <span class="badge bg-success">{{ _('Sí') }}</span>
33
33
  {% else %}
34
- <span class="badge bg-secondary">{{ _('No') }}</span>
34
+ <span class="badge bg-secondary">{{ _('No') }}</span>
35
35
  {% endif %}
36
36
  </td>
37
37
  <td>
38
38
  {% if plugin.active %}
39
- <span class="badge bg-success">{{ _('Activo') }}</span>
39
+ <span class="badge bg-success">{{ _('Activo') }}</span>
40
40
  {% else %}
41
- <span class="badge bg-warning">{{ _('Inactivo') }}</span>
41
+ <span class="badge bg-warning">{{ _('Inactivo') }}</span>
42
42
  {% endif %}
43
43
  </td>
44
44
  <td>
45
- <form action="{{ url_for('plugins.toggle', plugin_id=plugin.id) }}" method="POST" class="d-inline">
45
+ <form action="{{ url_for('plugins.toggle', plugin_id=plugin.id) }}" method="POST"
46
+ class="d-inline">
47
+ <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
46
48
  {% if plugin.active %}
47
- <button type="submit" class="btn btn-sm btn-outline-warning">
48
- <i class="bi bi-toggle-off"></i>
49
- {{ _('Desactivar') }}
50
- </button>
49
+ <button type="submit" class="btn btn-sm btn-outline-warning">
50
+ <i class="bi bi-toggle-off"></i>
51
+ {{ _('Desactivar') }}
52
+ </button>
51
53
  {% else %}
52
- <button type="submit" class="btn btn-sm btn-outline-success" {% if not plugin.installed %}disabled{% endif %}>
53
- <i class="bi bi-toggle-on"></i>
54
- {{ _('Activar') }}
55
- </button>
54
+ <button type="submit" class="btn btn-sm btn-outline-success"
55
+ {% if not plugin.installed %}disabled{% endif %}>
56
+ <i class="bi bi-toggle-on"></i>
57
+ {{ _('Activar') }}
58
+ </button>
56
59
  {% endif %}
57
60
  </form>
58
61
  </td>
coati_payroll/version.py CHANGED
@@ -15,4 +15,4 @@
15
15
  Data model for the payroll module.
16
16
  """
17
17
 
18
- __version__ = "0.0.6"
18
+ __version__ = "0.0.8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: coati-payroll
3
- Version: 0.0.6
3
+ Version: 0.0.8
4
4
  Summary: A jurisdiction-agnostic payroll calculation engine.
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -2,7 +2,7 @@ coati_payroll/__init__.py,sha256=UMMb03475dPNvlnvP4TuyNH0GAmL1FjPi5ND92-igbc,161
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
5
- coati_payroll/cli.py,sha256=fptyskL-5NKuk51CZeHNCp54nAVkrdyztmQ75RPvATM,47424
5
+ coati_payroll/cli.py,sha256=n1DbogA1dYH_Jbs393pvpT_DPi6vSwKWR0sGjsYcbhY,47962
6
6
  coati_payroll/config.py,sha256=dM3kcUsW6_gR1Vopdb_28fWxmhUi7lkj30kJfSU8zrY,9420
7
7
  coati_payroll/demo_data.py,sha256=pE7DUwZWq3jHCwt6vO_kW0sIuMFJmu9u1pqKUGWF9Ag,31437
8
8
  coati_payroll/enums.py,sha256=TEJ8Yxy-0UPsQUSDs7pbZgOg-VoqFOx8KnY0lTh3KzA,9211
@@ -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=b0rLFUsGt-KYZPWh4tSpBeGqdJBOYfIO3cDuIAFJMIg,20406
25
25
  coati_payroll/vacation_service.py,sha256=iMgE7CcCfd5ytCWknyokFlphfYrnmAu6jtlPIPzgpHQ,17600
26
- coati_payroll/version.py,sha256=zbMD95OU5yJLXcUdVL8iFukCD1cZb7r10hWXCltvPKM,649
26
+ coati_payroll/version.py,sha256=71HuPZkbFfAs5uuL71uIVSiuRYNR1TkAqzucPvGKX_U,649
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
@@ -157,7 +157,7 @@ coati_payroll/templates/modules/planilla/ver_nomina.html,sha256=RPq5oriGArt4UTE2
157
157
  coati_payroll/templates/modules/planilla/ver_nomina_empleado.html,sha256=3SN62UbFjlds-URkP4Ko_t0JsF8zu25fbBZkMqHhQ20,9353
158
158
  coati_payroll/templates/modules/planilla/novedades/form.html,sha256=GnTNRjiukaSqJyyS13-47kWSIIqBLhH9OfYFD7oQGIw,6678
159
159
  coati_payroll/templates/modules/planilla/novedades/index.html,sha256=VsaJ6MkSeF-lAPy-aN7LTubOmMXdNi_wYKvS3YdoZL8,7918
160
- coati_payroll/templates/modules/plugins/index.html,sha256=RtWAPJpzmQtkv3j__cRt1Rx8ixNX7NWq1fF2FRlxNwo,3289
160
+ coati_payroll/templates/modules/plugins/index.html,sha256=dsWsUFqqqPHfYnPXyUwyyhXmUgkNp89uA5dBbVqgdvI,3420
161
161
  coati_payroll/templates/modules/prestacion/form.html,sha256=ry4TFxLoZvdgo-OEtLmC-rsk1qntGmgq2YS3ekMtcT0,49
162
162
  coati_payroll/templates/modules/prestacion/index.html,sha256=5mSd4BkL8TLrofWWXEv-HSwUA-_skbxnwv328WuzX-8,50
163
163
  coati_payroll/templates/modules/prestacion_management/dashboard.html,sha256=WRoFg2am3CqyO3U6JXf6cj0vl1vgX0nsJdSsQJSva5A,7279
@@ -238,9 +238,9 @@ coati_payroll/vistas/planilla/services/novedad_service.py,sha256=MYxbiqVrwzBbBTX
238
238
  coati_payroll/vistas/planilla/services/planilla_service.py,sha256=xpqxD6XLdTMRJfbPhvpWSYW7P6IcHKZgW6Ahg7kthk4,1195
239
239
  coati_payroll/vistas/planilla/validators/__init__.py,sha256=K-WnUGZaMYX-2DcduB-yMssuxUlztMCQKuGfqK67Vsk,754
240
240
  coati_payroll/vistas/planilla/validators/planilla_validators.py,sha256=WH1cyY1D7XPSb3MupNszofT3-YvgqBfp8vFDpo8hDA8,1680
241
- coati_payroll-0.0.6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
242
- coati_payroll-0.0.6.dist-info/METADATA,sha256=JocS6njhfnxzigEfzhUIQvvguFpmPajxYRAZpN9NqzE,22236
243
- coati_payroll-0.0.6.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
244
- coati_payroll-0.0.6.dist-info/entry_points.txt,sha256=GtZVGVYEFlpeSs7eHYh701VG7ftRRrZ54fsyFmbeZZc,54
245
- coati_payroll-0.0.6.dist-info/top_level.txt,sha256=wRaRlWHJnSoqktbTT1XJUkPNgKnR7VS75Ytyl8JJYPY,14
246
- coati_payroll-0.0.6.dist-info/RECORD,,
241
+ coati_payroll-0.0.8.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
242
+ coati_payroll-0.0.8.dist-info/METADATA,sha256=ygoFGtenvczpEJCka7hElbztSSdL87hEWLp4ipAIa-s,22236
243
+ coati_payroll-0.0.8.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
244
+ coati_payroll-0.0.8.dist-info/entry_points.txt,sha256=GtZVGVYEFlpeSs7eHYh701VG7ftRRrZ54fsyFmbeZZc,54
245
+ coati_payroll-0.0.8.dist-info/top_level.txt,sha256=wRaRlWHJnSoqktbTT1XJUkPNgKnR7VS75Ytyl8JJYPY,14
246
+ coati_payroll-0.0.8.dist-info/RECORD,,