Skip to content

Commit 27dcaa5

Browse files
committed
Raise correct error when refreshing DB tasks
1 parent 1debecb commit 27dcaa5

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

django_tasks/backends/database/backend.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from dataclasses import asdict, dataclass
1+
from dataclasses import dataclass
22
from typing import TYPE_CHECKING, Any, List, TypeVar
33

44
from django.apps import apps
@@ -23,16 +23,6 @@
2323
class TaskResult(BaseTaskResult[T]):
2424
db_result: "DBTaskResult"
2525

26-
def refresh(self) -> None:
27-
self.db_result.refresh_from_db()
28-
for attr, value in asdict(self.db_result.task_result).items():
29-
setattr(self, attr, value)
30-
31-
async def arefresh(self) -> None:
32-
await self.db_result.arefresh_from_db()
33-
for attr, value in asdict(self.db_result.task_result).items():
34-
setattr(self, attr, value)
35-
3626

3727
class DatabaseBackend(BaseTaskBackend):
3828
supports_async_task = True

0 commit comments

Comments
 (0)