question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'TransitionApproval' object has no attribute 'iteration'

See original GitHub issue

Program raise error as title when I try to jump state

Is this a bug? I think iteration is a field in Transition model, not TransitionApproval

source in river.core.instanceworkflowobject.py (line:91)

    @property
    def recent_approval(self):
        try:
            return getattr(self.workflow_object, self.field_name + "_transition_approvals").filter(transaction_date__isnull=False).latest('transaction_date')
        except TransitionApproval.DoesNotExist:
            return None

    @transaction.atomic
    def jump_to(self, state):
        def _transitions_before(iteration):
            return Transition.objects.filter(workflow=self.workflow, workflow_object=self.workflow_object, iteration__lte=iteration)

        try:
            recent_iteration = self.recent_approval.iteration if self.recent_approval else 0
            jumped_transition = getattr(self.workflow_object, self.field_name + "_transitions").filter(
                iteration__gte=recent_iteration, destination_state=state, status=PENDING
            ).earliest("iteration")

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
xuziheng1002commented, Feb 7, 2020

Fixed it in #139 Close

1reaction
xuziheng1002commented, Feb 4, 2020

Hi @xuziheng1002 At first glance, it seems to be. I would appreciate it if you can create PR with a test case for this. Otherwise, I can do it sometime this week.

OK, I will create PR with testCase this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: module 'collections' has no attribute 'Iterator'
I am using a virtual environment as well which has the Django installed on it. I tried uninstalling the django and reinstalling but...
Read more >
module 'collections' has no attribute 'Iterator' | Django | Python
Topic :-------- Attribute Error : module 'collections' has no attribute ' Iterator ' | Aryadrj - Django error- Python ...
Read more >
iterators
In Python, we typically perform iteration using the for loop. ... AttributeError: 'list' object has no attribute '__next__'. An iterator's __next__ method ...
Read more >
Python AttributeError: 'tuple' object has no attribute
AttributeError : 'tuple' object has no attribute. Learn Data Science with. This error occurs when attempting to access the values of a tuple...
Read more >
object has no attribute '_state' - Google Groups
AttributeError : 'Question' object has no attribute '_state' The class definitions are : class QuestionSet(models.Model): title = models.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found