mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 20:46:47 +00:00
make logic simpler (#8613)
This commit is contained in:
parent
f9487597fb
commit
f7697bd481
@ -119,7 +119,7 @@ def ensure_sso_groups(sender, sociallogin: SocialLogin, **kwargs):
|
|||||||
# remove groups not listed by SSO if not disabled
|
# remove groups not listed by SSO if not disabled
|
||||||
if get_global_setting('SSO_REMOVE_GROUPS'):
|
if get_global_setting('SSO_REMOVE_GROUPS'):
|
||||||
for group in user.groups.all():
|
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}')
|
logger.info(f'Removing group {group.name} from {user}')
|
||||||
user.groups.remove(group)
|
user.groups.remove(group)
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ def allow_table_event(table_name):
|
|||||||
'part_partstocktakereport',
|
'part_partstocktakereport',
|
||||||
]
|
]
|
||||||
|
|
||||||
return not table_name in ignore_tables
|
return table_name not in ignore_tables
|
||||||
|
|
||||||
|
|
||||||
@receiver(post_save)
|
@receiver(post_save)
|
||||||
|
@ -1359,7 +1359,7 @@ class StockItem(
|
|||||||
if self.installed_item_count() > 0:
|
if self.installed_item_count() > 0:
|
||||||
return False
|
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]:
|
def get_installed_items(self, cascade: bool = False) -> set[StockItem]:
|
||||||
"""Return all stock items which are *installed* in this one!
|
"""Return all stock items which are *installed* in this one!
|
||||||
@ -1542,7 +1542,7 @@ class StockItem(
|
|||||||
if self.belongs_to is not None:
|
if self.belongs_to is not None:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return not self.sales_order is not None
|
return self.sales_order is None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def tracking_info_count(self):
|
def tracking_info_count(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user