membershipworks: Handle case where scrape task has never been run in admin action
This commit is contained in:
parent
97bcc1df6d
commit
8d78868e88
@ -32,7 +32,10 @@ class BaseMembershipWorksAdmin(DjangoObjectActions, ReadOnlyAdmin):
|
||||
.order_by("started")
|
||||
.last()
|
||||
)
|
||||
tool["label"] = f"Refresh Data [Last Run {naturaltime(last_run.started)}]"
|
||||
last_run_time = (
|
||||
naturaltime(last_run.started) if last_run is not None else "Never"
|
||||
)
|
||||
tool["label"] = f"Refresh Data [Last Run {last_run_time}]"
|
||||
return tool
|
||||
|
||||
@action
|
||||
|
Loading…
Reference in New Issue
Block a user