2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-03 20:20:58 +00:00

Merge branch 'master' of https://github.com/inventree/InvenTree into matmair/issue2279

This commit is contained in:
Matthias
2022-02-12 00:51:15 +01:00
103 changed files with 27416 additions and 23821 deletions

View File

@ -354,7 +354,7 @@ class BaseInvenTreeSetting(models.Model):
setting.value = str(value)
setting.save()
key = models.CharField(max_length=50, blank=False, unique=False, help_text=_('Settings key (must be unique - case insensitive'))
key = models.CharField(max_length=50, blank=False, unique=False, help_text=_('Settings key (must be unique - case insensitive)'))
value = models.CharField(max_length=200, blank=True, unique=False, help_text=_('Settings value'))
@ -781,6 +781,18 @@ class InvenTreeSetting(BaseInvenTreeSetting):
'validator': bool,
},
# 2022-02-03
# This setting exists as an interim solution for extremely slow part page load times when the part has a complex BOM
# In an upcoming release, pricing history (and BOM pricing) will be cached,
# rather than having to be re-calculated every time the page is loaded!
# For now, we will simply hide part pricing by default
'PART_SHOW_PRICE_HISTORY': {
'name': _('Show Price History'),
'description': _('Display historical pricing for Part'),
'default': False,
'validator': bool,
},
'PART_SHOW_RELATED': {
'name': _('Show related parts'),
'description': _('Display related parts for a part'),
@ -1480,11 +1492,9 @@ class WebhookEndpoint(models.Model):
def process_webhook(self):
if self.token:
self.token = self.token
self.verify = VerificationMethod.TOKEN
# TODO make a object-setting
if self.secret:
self.secret = self.secret
self.verify = VerificationMethod.HMAC
# TODO make a object-setting
return True
@ -1494,6 +1504,7 @@ class WebhookEndpoint(models.Model):
# no token
if self.verify == VerificationMethod.NONE:
# do nothing as no method was chosen
pass
# static token