Compare commits
4 Commits
formatting
...
2.21.3
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c33c61a6d | |||
| 71afb1275f | |||
| 78c55b787f | |||
| 34f2dc2ab6 |
@@ -101,8 +101,17 @@ class AutomationContext:
|
||||
commit = self.speckle_client.commit.get(
|
||||
self.automation_run_data.project_id, version_id
|
||||
)
|
||||
if not commit.referencedObject:
|
||||
raise ValueError("The commit has no referencedObject, cannot receive it.")
|
||||
if not commit or not commit.referencedObject:
|
||||
raise ValueError(
|
||||
f"""\
|
||||
Could not receive specified version.
|
||||
{"The commit has no referencedObject." if not commit.referencedObject else ""}
|
||||
Is your environment configured correctly?
|
||||
project_id: {self.automation_run_data.project_id}
|
||||
model_id: {self.automation_run_data.triggers[0].payload.model_id}
|
||||
version_id: {self.automation_run_data.triggers[0].payload.version_id}
|
||||
"""
|
||||
)
|
||||
base = operations.receive(
|
||||
commit.referencedObject, self._server_transport, self._memory_transport
|
||||
)
|
||||
|
||||
@@ -126,7 +126,7 @@ class Version(BaseModel):
|
||||
|
||||
|
||||
class Model(BaseModel):
|
||||
author: LimitedUser
|
||||
author: Optional[LimitedUser]
|
||||
createdAt: datetime
|
||||
description: Optional[str]
|
||||
displayName: str
|
||||
|
||||
@@ -86,6 +86,12 @@ class ServerTransport(AbstractTransport):
|
||||
|
||||
self.session = requests.Session()
|
||||
|
||||
self.session.headers.update(
|
||||
{
|
||||
"Accept": "text/plain",
|
||||
}
|
||||
)
|
||||
|
||||
if self.account is not None:
|
||||
self._batch_sender = BatchSender(
|
||||
self.url, self.stream_id, self.account.token, max_batch_size_mb=1
|
||||
@@ -93,7 +99,6 @@ class ServerTransport(AbstractTransport):
|
||||
self.session.headers.update(
|
||||
{
|
||||
"Authorization": f"Bearer {self.account.token}",
|
||||
"Accept": "text/plain",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user