You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're new to the twined ecosystem, and you don't mind, it'd be great to hear a little bit of the wider context about
you and what you're working on, so we can understand how best to help.
What is the current behavior?
If self.get_service_revision() is None in the following code, we get an error...
defask(self, save=True):
"""Ask a question to a service_revision. :param boolean save: If true, this question will be saved in order to update the 'asked' time. """service_revision=self.get_service_revision()
subscription, push_url=service_revision.ask(
question_id=self.id,
input_values=self.get_input_values(),
input_manifest=self.get_input_manifest(),
)
The error is:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/django_gcp/tasks/tasks.py", line 116, in execute
return self.run(**task_kwargs), 200
File "/workspace/server/example/tasks.py", line 44, in run
raise e
File "/workspace/server/example/tasks.py", line 40, in run
question.ask()
File "/workspace/server/example/models.py", line 129, in ask
subscription, push_url, service_revision = super().ask(save=False)
File "/usr/local/lib/python3.9/site-packages/django_twined/models/questions.py", line 82, in ask
subscription, push_url = service_revision.ask(
AttributeError: 'NoneType' object has no attribute 'ask'
What is the expected behavior?
It's a mistake to send a NoneType through to here, but could happen commonly, so a ValueError should be raised if the service_revision is not a valid class instance.
The text was updated successfully, but these errors were encountered:
Bug report
About me
If you're new to the twined ecosystem, and you don't mind, it'd be great to hear a little bit of the wider context about
you and what you're working on, so we can understand how best to help.
What is the current behavior?
If
self.get_service_revision()
isNone
in the following code, we get an error...The error is:
What is the expected behavior?
It's a mistake to send a NoneType through to here, but could happen commonly, so a ValueError should be raised if the service_revision is not a valid class instance.
The text was updated successfully, but these errors were encountered: