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

Fix Account Sync #114

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/business_central/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _sync_data(self, data, attribute_type, display_name, workspace_id, field_nam
else:
active = False
if attribute_type == 'ACCOUNT':
if item.get('accountType') != 'Posting':
if item.get('accountType') != 'Posting' or not item.get('directPosting'):
Copy link

Choose a reason for hiding this comment

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

Avoid inequality comparisons to True; use if not item.get('blocked'): for false checks.

- if (attribute_type == 'EMPLOYEE' and item.get('status') == 'Active') or (attribute_type in ('LOCATION', 'COMPANY')) or (item.get('blocked') is not None and item.get('blocked') != True):
+ if (attribute_type == 'EMPLOYEE' and item.get('status') == 'Active') or (attribute_type in ('LOCATION', 'COMPANY')) or (item.get('blocked') is not None and not item.get('blocked')):

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
if item.get('accountType') != 'Posting' or not item.get('directPosting'):
if item.get('accountType') != 'Posting' or not item.get('directPosting'):

continue
destination_attributes.append(self._create_destination_attribute(
attribute_type,
Expand Down
Loading