Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem Retrieving Project by id #182

Closed
philippcheung opened this issue Apr 28, 2024 · 5 comments
Closed

Problem Retrieving Project by id #182

philippcheung opened this issue Apr 28, 2024 · 5 comments

Comments

@philippcheung
Copy link

philippcheung commented Apr 28, 2024

Description

I'm new to python-taiga and taiga in general, so it might just be the way I created the project.

project = self.api.projects.get(11)

gives error:

cls = <class 'taiga.models.models.SwimLanes'>, requester = <taiga.requestmaker.RequestMaker object at 0x7f6f03dd20b0>, entries = None

@classmethod
def parse(cls, requester, entries):
    """Parse a JSON array into a list of model instances."""
    result_entries = SearchableList()
  for entry in entries:

E TypeError: 'NoneType' object is not iterable

/root/.cache/pypoetry/virtualenvs/shadowstreamserver-9TtSrW0h-py3.10/lib/python3.10/site-packages/taiga/models/base.py:107: TypeError

Steps to reproduce

Step 1) Create a new project in GUI (barebone project, nothing extra)
Step 2) write pytest unit test to retrieve project

project = self.api.projects.get(11)

/root/.cache/pypoetry/virtualenvs/shadowstreamserver-9TtSrW0h-py3.10/lib/python3.10/site-packages/taiga/models/base.py:93: in get
return self.instance.parse(self.requester, response.json())
/root/.cache/pypoetry/virtualenvs/shadowstreamserver-9TtSrW0h-py3.10/lib/python3.10/site-packages/taiga/models/base.py:199: in parse
entry[key_to_parse] = cls_to_parse.parse(requester, entry[key_to_parse])


cls = <class 'taiga.models.models.SwimLanes'>, requester = <taiga.requestmaker.RequestMaker object at 0x7f6f03dd20b0>, entries = None

@classmethod
def parse(cls, requester, entries):
    """Parse a JSON array into a list of model instances."""
    result_entries = SearchableList()
  for entry in entries:

E TypeError: 'NoneType' object is not iterable

/root/.cache/pypoetry/virtualenvs/shadowstreamserver-9TtSrW0h-py3.10/lib/python3.10/site-packages/taiga/models/base.py:107: TypeError

Versions

Python 3.10.14
Taiga -- using latest taiga docker (https://github.com/taigaio/taiga-docker.git, Stable Branch, Tag 6.0.0)
django version inside docker - 3.2.19

Expected behaviour

Project object to come back without error

Actual behaviour

Exception thrown :E TypeError: 'NoneType' object is not iterable

Additional information

Please feel to reach out to me with any information -- for now, I'm just going to add project_extra_information to the project_extra_info UserStories allowed params so I can get the project name easily -- versus loading the object and getting the name like I was planning on.

@PeterSurda
Copy link

Also happens when creating a new project. Appears to do with parsing swimlanes. If you modify the code to skip parsing swimlanes, it seems to work ok. Maybe it can't handle a situation where there are no swimlanes, or maybe the swimlane schema changed.

PeterSurda added a commit to PeterSurda/python-taiga that referenced this issue Jun 2, 2024
@PeterSurda PeterSurda mentioned this issue Jun 2, 2024
PeterSurda added a commit to PeterSurda/python-taiga that referenced this issue Jun 2, 2024
@psybers
Copy link
Contributor

psybers commented Dec 29, 2024

Duplicate of #169. It looks like #168 would fix it.

@protoroto
Copy link
Member

@psybers @PeterSurda @philippcheung I've just released 1.3.1 version that should address this issue. Could you please check if everything is working as expected now?

@psybers
Copy link
Contributor

psybers commented Jan 15, 2025

@protoroto I can confirm the old behavior/bug and that it works with the latest release.

@protoroto
Copy link
Member

@psybers Thanks for the feedback! Going to close this, @philippcheung @PeterSurda if this problem is still there with the new release feel free to open a new issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants