Re4matting
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user