Re4matting
This commit is contained in:
parent
b62eb5cb22
commit
26b8b5f334
@ -681,14 +681,14 @@ def _import(search, after, before):
|
||||
):
|
||||
click.secho(
|
||||
f"fact {f.id}: project @{mappings[0].kimai_project.id} {mappings[0].kimai_project.name} does not allow global activity {mappings[0].kimai_activity}",
|
||||
fg="red"
|
||||
fg="red",
|
||||
)
|
||||
has_errors = True
|
||||
continue
|
||||
if f.imports.count() > 0:
|
||||
click.secho(
|
||||
f"fact {f.id}: activity @{f.activity.id} {f.activity.name} was already imported {f.imports.count()} time(s)",
|
||||
fg="yellow"
|
||||
fg="yellow",
|
||||
)
|
||||
continue
|
||||
|
||||
@ -717,7 +717,9 @@ def _import(search, after, before):
|
||||
project=mapping.kimai_project,
|
||||
begin=f.start_time,
|
||||
end=f.end_time,
|
||||
description=f.description if f.description != "" else mapping.kimai_description,
|
||||
description=f.description
|
||||
if f.description != ""
|
||||
else mapping.kimai_description,
|
||||
# tags=f.tags if f.tags != '' else mapping.kimai_tags
|
||||
)
|
||||
r = t.upload().json()
|
||||
@ -725,12 +727,14 @@ def _import(search, after, before):
|
||||
print(r)
|
||||
print(f"{f.id} ({f.activity.category.name} » {f.activity.name})")
|
||||
from pdb import set_trace
|
||||
|
||||
set_trace()
|
||||
|
||||
else:
|
||||
HamsterFactKimaiImport.create(hamster_fact=f, kimai_id=r["id"]).save()
|
||||
print(f'Created Kimai timesheet {r["id"]}')
|
||||
|
||||
|
||||
@kimai.group("db")
|
||||
def db_():
|
||||
pass
|
||||
|
@ -177,7 +177,7 @@ class Timesheet(BaseAPI):
|
||||
|
||||
@staticmethod
|
||||
def list_by(api, **kwargs):
|
||||
kwargs['size'] = 10000
|
||||
kwargs["size"] = 10000
|
||||
return [
|
||||
Timesheet(
|
||||
api,
|
||||
@ -189,10 +189,7 @@ class Timesheet(BaseAPI):
|
||||
t["description"],
|
||||
t["tags"],
|
||||
)
|
||||
for t in api.get(
|
||||
"timesheets",
|
||||
params=kwargs
|
||||
)
|
||||
for t in api.get("timesheets", params=kwargs)
|
||||
]
|
||||
|
||||
@staticmethod
|
||||
|
@ -13,9 +13,7 @@ from ..db import (
|
||||
KimaiCustomer,
|
||||
KimaiActivity,
|
||||
)
|
||||
from ..kimaiapi import (
|
||||
Timesheet as KimaiAPITimesheet
|
||||
)
|
||||
from ..kimaiapi import Timesheet as KimaiAPITimesheet
|
||||
|
||||
from .list import ListPane
|
||||
|
||||
@ -127,7 +125,7 @@ class KimaiActivityList(ListPane):
|
||||
activity.id,
|
||||
truncate(activity.name, 40),
|
||||
activity.visible,
|
||||
'?'
|
||||
"?",
|
||||
]
|
||||
for activity in activities
|
||||
]
|
||||
@ -162,10 +160,7 @@ class KimaiActivityList(ListPane):
|
||||
activity_id = row_cells[2]
|
||||
count = len(KimaiAPITimesheet.list_by(self.app.api, activity=activity_id))
|
||||
|
||||
self.table.update_cell_at(
|
||||
Coordinate(row_idx, 5),
|
||||
count
|
||||
)
|
||||
self.table.update_cell_at(Coordinate(row_idx, 5), count)
|
||||
|
||||
|
||||
class KimaiScreen(Screen):
|
||||
|
Loading…
Reference in New Issue
Block a user