Skip to content

fix: is_schedule#2643

Merged
jmcouffin merged 1 commit intopyrevitlabs:developfrom
leyarx:fix/get_all_schedules
Apr 11, 2025
Merged

fix: is_schedule#2643
jmcouffin merged 1 commit intopyrevitlabs:developfrom
leyarx:fix/get_all_schedules

Conversation

@leyarx
Copy link
Copy Markdown
Contributor

@leyarx leyarx commented Apr 11, 2025

Fix bug in query get_all_schedules

Description

This pull request addresses an issue encountered when calling the get_all_schedules function in the query.py module. The error, AttributeError: 'NoneType' object has no attribute 'Settings', occurs when attempting to retrieve schedules from a document that has been just opened with HOST_APP.app.OpenDocumentFile() method.


Checklist

Before submitting your pull request, ensure the following requirements are met:

  • Code follows the PEP 8 style guide.
  • Code has been formatted with Black using the command:
  • Changes are tested and verified to work as expected.

Copy link
Copy Markdown
Contributor

@devloai devloai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary:

This PR addresses a bug in the get_all_schedules function where calling this function on a document that has just been opened with HOST_APP.app.OpenDocumentFile() would result in AttributeError: 'NoneType' object has no attribute 'Settings'. The fix properly provides the document context to the get_category function call in the is_schedule function.

Review Summary:

The fix is correct, focused, and properly addresses the root cause of the issue. By ensuring the proper document context is passed to the get_category function, it prevents the NoneType error when working with newly opened documents. Please let me know if you have any feedback on this review.

Follow-up suggestions:

@devloai consider adding a unit test that verifies this functionality with a newly opened document

@leyarx leyarx marked this pull request as ready for review April 11, 2025 12:59
@jmcouffin jmcouffin requested a review from Copilot April 11, 2025 14:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

@jmcouffin jmcouffin merged commit 1e56d35 into pyrevitlabs:develop Apr 11, 2025
@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25101+1501-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25104+0813-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25104+1015-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25104+1041-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25104+1127-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25105+0957-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25106+0734-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25106+1252-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25106+1322-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25106+1408-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25107+0621-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25116+1412-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25118+1113-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25119+1928-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25133+1246-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25136+0631-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25136+0639-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25140+1615-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25141+1904-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25143+0904-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25146+0559-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25149+1012-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25149+1943-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 2, 2025

📦 New work-in-progress (wip) builds are available for 5.1.0.25153+1459-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 3, 2025

📦 New work-in-progress (wip) builds are available for 5.1.0.25154+0858-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 3, 2025

📦 New work-in-progress (wip) builds are available for 5.1.0.25154+0920-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 4, 2025

📦 New work-in-progress (wip) builds are available for 5.1.0.25155+0904-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25162+1125-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25162+1306-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25162+2030-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25164+0700-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25164+1347-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25164+1420-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25164+1830-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25171+0757-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25181+1313-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New public release are available for 5.2.0.25181+1425

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants