2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 04:55:44 +00:00

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

This commit is contained in:
Matthias Mair
2022-05-16 17:48:01 +02:00
126 changed files with 13394 additions and 12710 deletions

View File

@ -2,9 +2,6 @@
Provides a JSON API for common components.
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.http.response import HttpResponse

View File

@ -199,7 +199,7 @@ class FileManager:
try:
# Excel import casts number-looking-items into floats, which is annoying
if item == int(item) and not str(item) == str(int(item)):
if item == int(item) and str(item) != str(int(item)):
data[idx] = int(item)
except ValueError:
pass

View File

@ -2,9 +2,6 @@
Django forms for interacting with common objects
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.utils.translation import gettext as _

View File

@ -3,9 +3,6 @@ Common database model definitions.
These models are 'generic' and do not fit a particular business logic object.
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import decimal
import math
@ -1802,10 +1799,8 @@ class WebhookEndpoint(models.Model):
def process_webhook(self):
if self.token:
self.verify = VerificationMethod.TOKEN
# TODO make a object-setting
if self.secret:
self.verify = VerificationMethod.HMAC
# TODO make a object-setting
return True
def validate_token(self, payload, headers, request):

View File

@ -2,9 +2,6 @@
JSON serializers for common components
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from InvenTree.serializers import InvenTreeModelSerializer
from InvenTree.helpers import get_objectreference

View File

@ -2,9 +2,6 @@
User-configurable settings for the common app
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from moneyed import CURRENCIES
from django.conf import settings

View File

@ -1,6 +1,3 @@
"""
Unit tests for the views associated with the 'common' app
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

View File

@ -133,7 +133,7 @@ class SettingsTest(TestCase):
if description is None:
raise ValueError(f'Missing GLOBAL_SETTING description for {key}') # pragma: no cover
if not key == key.upper():
if key != key.upper():
raise ValueError(f"SETTINGS key '{key}' is not uppercase") # pragma: no cover
def test_defaults(self):

View File

@ -2,9 +2,6 @@
Django views for interacting with common models
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.utils.translation import gettext_lazy as _