mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-23 09:16:51 +00:00
Fix job uid generation
This commit is contained in:
parent
32278e9063
commit
d7cba49c4a
|
@ -14,7 +14,7 @@ class JobMutations:
|
|||
@strawberry.mutation(permission_classes=[IsAuthenticated])
|
||||
def remove_job(self, job_id: str) -> GenericMutationReturn:
|
||||
"""Remove a job from the queue"""
|
||||
result = Jobs().remove_by_uuid(job_id)
|
||||
result = Jobs().remove_by_uid(job_id)
|
||||
if result:
|
||||
return GenericMutationReturn(
|
||||
success=True,
|
||||
|
|
|
@ -45,7 +45,7 @@ class Job(BaseModel):
|
|||
Job class.
|
||||
"""
|
||||
|
||||
uid: UUID = uuid.uuid4()
|
||||
uid: UUID
|
||||
type_id: str
|
||||
name: str
|
||||
description: str
|
||||
|
@ -108,6 +108,7 @@ class Jobs:
|
|||
Add a job to the jobs list.
|
||||
"""
|
||||
job = Job(
|
||||
uid=uuid.uuid4(),
|
||||
name=name,
|
||||
type_id=type_id,
|
||||
description=description,
|
||||
|
@ -133,9 +134,9 @@ class Jobs:
|
|||
"""
|
||||
Remove a job from the jobs list.
|
||||
"""
|
||||
self.remove_by_uuid(str(job.uid))
|
||||
self.remove_by_uid(str(job.uid))
|
||||
|
||||
def remove_by_uuid(self, job_uuid: str) -> bool:
|
||||
def remove_by_uid(self, job_uuid: str) -> bool:
|
||||
"""
|
||||
Remove a job from the jobs list.
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue