2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-30 12:36:45 +00:00

make logic simpler (#8613)

This commit is contained in:
Matthias Mair 2024-12-02 00:49:28 +01:00 committed by GitHub
parent f9487597fb
commit f7697bd481
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -119,7 +119,7 @@ def ensure_sso_groups(sender, sociallogin: SocialLogin, **kwargs):
# remove groups not listed by SSO if not disabled
if get_global_setting('SSO_REMOVE_GROUPS'):
for group in user.groups.all():
if not group.name in group_names:
if group.name not in group_names:
logger.info(f'Removing group {group.name} from {user}')
user.groups.remove(group)

View File

@ -160,7 +160,7 @@ def allow_table_event(table_name):
'part_partstocktakereport',
]
return not table_name in ignore_tables
return table_name not in ignore_tables
@receiver(post_save)

View File

@ -1359,7 +1359,7 @@ class StockItem(
if self.installed_item_count() > 0:
return False
return not self.sales_order is not None
return self.sales_order is None
def get_installed_items(self, cascade: bool = False) -> set[StockItem]:
"""Return all stock items which are *installed* in this one!
@ -1542,7 +1542,7 @@ class StockItem(
if self.belongs_to is not None:
return False
return not self.sales_order is not None
return self.sales_order is None
@property
def tracking_info_count(self):