Commit Graph
100 Commits
Author SHA1 Message Date
Matthias MairandOliver f9d2b149c6 Add sanitation for SVG file uploads 2022-09-23 17:05:02 +10:00
Matthias MairandGitHub ae07247a82 Add links to all notifications that do not have a link (#3431)
* refactor link

* [FR] Error notifications should provide link to the error
Fixes #3367
2022-07-31 11:23:07 +10:00
Matthias MairandGitHub 742e579fa7 [FR] Don't log 404 errors (#3436)
* [FR] Don't log 404 errors
Fixes #3418

* move ignored errors to settings

* Add unittest

* Add test for not ignored errors

* Add check for manual logging
2022-07-31 10:10:49 +10:00
Matthias MairandGitHub 486a956f42 Switch to Enum (#3437) 2022-07-31 09:21:09 +10:00
Matthias MairandGitHub 2ad0fa11f8 add no cov to settings (#3439) 2022-07-31 09:19:48 +10:00
Matthias MairandGitHub 9ccf211650 fix gtipod.io (#3415) 2022-07-29 18:42:38 +10:00
Matthias MairandGitHub e461a2c1ef Development improvements (#3413)
* rename .env to make sure it is not loaded by default

* make sure migrations are run before import

* Add more messaget to setup_test

* add comments to setup-dev

* Add flag to setup-dev for setting up test data

* add flag to setup-test to also run development setup

* extend contributing with the flags

* change flag to tests

* Add option helptexts

* A nicer starter

* add 3 liner

* Revert "rename .env to make sure it is not loaded by default"

This reverts commit 95fa0bbc53.
2022-07-29 14:58:54 +10:00
Matthias MairandGitHub 794e375009 Switch to pathlib (#3392)
* switch to pathlib

* more pathlib

* useconvert env to path

* fix typo

* use resolve instead of absolute

* fix gitppod

* also allow parents

* replace more os operations

* fix string replacement feature

* make sure root dirs exsist

* fix replace function

* refactor duplicate code

* reduce code

* make sure dirs exist

* fix typo

* also create parent dirs

* fix match statement

* fix statments expecting string

* return getMigrationFileNames to old behaviour

* fully resolve config file

* make sure comparison works

* use pathlib in tasks

* fix file count test

* reduce code duplication in test + add test for part

* fix test

* re-add os

* Make pathlib usage simpler
2022-07-27 10:42:34 +10:00
Matthias MairandGitHub 551f66ff90 [BUG] Extra url schemes not working. (#3414)
* [BUG] Extra url schemes not working.
Fixes #3411

* style fixes

* style fixes

* add docstring
2022-07-27 10:23:09 +10:00
Matthias MairandGitHub 6c71a26613 make sure pip is upgraded (#3401)
At the beginning of installs
2022-07-26 11:21:25 +10:00
Matthias MairandGitHub 864d69d968 Add test command (#3372)
* integrate test loading as task - use with gitpod

* ignore test data with git
2022-07-21 11:41:42 +10:00
Matthias MairandGitHub 09987ad79b Remove special characters restriction in category names (#3370)
* [FR]Special characters restriction in category names
Fixes #3358

* remove old validation test
2022-07-21 11:33:21 +10:00
Matthias MairandGitHub dbbdaf39c7 [FR] Sign artifacts with sigstore (#3347)
Fixes #3077
2022-07-20 16:20:58 +10:00
Matthias MairandGitHub cbae4474ab Allow installation of local plugins via docker (#3348)
* Add option to mpunt plugins to docker

* [FR] Allow installation of local plugins via docker
Fixes #3343
2022-07-19 08:18:54 +10:00
Matthias MairandGitHub 7549d033df Use env-variable for image tag (#3350) 2022-07-18 09:09:04 +10:00
Matthias MairandGitHub 6aeb818137 Fix pre-commit complaints (#3349)
* fixes a B023 error by refactoring the function call

* restructure for correct lambda
2022-07-18 08:57:14 +10:00
Matthias MairandGitHub d5014ab6ac Fix POST testing (#3346)
* make call simpler

* switch back to reqres.in for POST
2022-07-18 08:35:23 +10:00
6133c745d7 [FR] Automated releases (#3316)
* [FR] Automated releases
automated messages on the socials
Fixes #3078

* Add more details to Reddit

* Fix twitter text

* fix syntax

* Update release.yml

Add hashtags to twitter post

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2022-07-10 22:23:10 +10:00
Matthias MairandGitHub 7493c8c6cb Use metadata in projects for plugin info (#3282)
* Use metadata in projects for plugin info

* use metadata as backup
2022-07-09 17:06:50 +10:00
Matthias MairandGitHub e314e879da Fix broken copy (#3314)
* update clipboard version

* attach clipboard to about model

* make definition simpler

* make version text copyable
2022-07-09 12:49:53 +10:00
Matthias MairandGitHub 4b0b76ecc5 Make "confirm" buttons a user-configurable option. (#3313)
* Make "confirm" buttons a user-configurable option.
Add a new setting to enable the confirm button
Fixes #3069

* Add seperator
2022-07-09 10:28:52 +10:00
Matthias MairandGitHub c81043ba42 [FR] Add unit testing for emails (#3281)
Fixes #2232
2022-07-03 20:38:26 +10:00
Matthias MairandGitHub 9f5526f489 BREAKING (#3283)
Removes the depreciated class IntegrationPluginBase
2022-07-03 12:32:35 +10:00
cf70e4220f Update requirements (#3228)
* Remove stat context variables

* Revert "Remove stat context variables"

This reverts commit 0989c308d0.

* remove old backport

* move requirements

* move isort

* move migrations-tests

* add pip-tools as req and add hook

* Use hashes and also run when txt files are added

* Update to hashes in requirements

* update requirements install path

* remove allauth-2fa for a test

* install dev-requirements

* re-enable allauth

* remove hashes from pre normal setup

* Remove version bindings if they are the laest

* move depencies to upper bound

* fix django-money

* remove windows specific requirements

* also install dependencies

* update markdownify

* remove django-admin-shell

* remove unneeded packages

* add docs

* remove pins and fix pre-commit pipeline

* pin django-money

* really remove admin shell

* return default behaviour for money serializer

* pip fix

* update filter name

* set decimal for output

* add migrations

* pin coveralls

* update requirements

Co-authored-by: Oliver Walters <oliver.henry.walters@gmail.com>
2022-06-28 22:12:00 +10:00
Matthias MairandGitHub b63ba4b636 [BUG] Duplication of "base URL" setting (#3263)
* [BUG] Duplication of "base URL" setting
Fixes #3196

Adds after_safe key to settings: this action is executed after the setting is saved. The current setting object is supplied to the function as the first argument.

* Add unittests

* fix style

* ammned allowed keys
2022-06-28 11:26:05 +10:00
Matthias MairandGitHub 7283197bac MFA remove improvement (#3239)
* temporary fix for GHSA-8j76-mm54-52xq

* return to setting afterwards
2022-06-23 12:21:10 +10:00
Matthias MairandGitHub 50a4bda184 Small changes to password changing (#3213)
* fix formatting

* also check for the old password

* validate that password matches the rules
2022-06-17 10:36:36 +10:00
Matthias MairandGitHub e83995b4f5 Add bleach (#41) (#3204)
* use shims for API view inheritation

* Add mixin for input sanitation

* fix clean operation to fix all string values

* Also clean up dicts
this is to future-proof this function

* Update docstirng

* proof custom methods against XSS through authenticated users
2022-06-16 10:01:53 +10:00
90aa7b8444 Sentry (#3174)
* Add sentry for optional error reporting
Closes https://github.com/inventreedb/org/issues/3
Heavily inspired by https://github.com/netbox-community/netbox/issues/9340

* do not consider optional stuff in coverage

* Add DSN for inventree org

Co-authored-by: Oliver Walters <oliver.henry.walters@gmail.com>
2022-06-11 23:13:13 +10:00
Matthias MairandGitHub 7c28bf1f64 Clean up tasks (#3175)
* Remove shell command
Fixes #3157

* Also run translation stats on updates

* remove style command

* remove import_fixtures command

* remove check

* fix docstirngs regarding D415

* move function up

* move task

* move task

* move tasks

* move task

* add section comments

* Revert "remove import_fixtures command"

This reverts commit e202ff2b80.
2022-06-11 10:07:57 +10:00
Matthias MairandGitHub f38386b13c Add more checks to pre-commit (#3132)
* Add bandit to pre-commit checks

* fix catchall exceptions

* remove unused definitons

* remove unuseed ariables

* Add docstring

* fix B006, B008 errors

* fix B007 error

* ignore B009

* Add checks for formatting and naming
2022-06-06 08:56:52 +10:00
0c97a50e47 Docstring checks in QC checks (#3089)
* Add pre-commit to the stack

* exclude static

* Add locales to excludes

* fix style errors

* rename pipeline steps

* also wait on precommit

* make template matching simpler

* Use the same code for python setup everywhere

* use step and cache for python setup

* move regular settings up into general envs

* just use full update

* Use invoke instead of static references

* make setup actions more similar

* use python3

* refactor names to be similar

* fix runner version

* fix references

* remove incidential change

* use matrix for os

* Github can't do this right now

* ignore docstyle errors

* Add seperate docstring test

* update flake call

* do not fail on docstring

* refactor setup into workflow

* update reference

* switch to action

* resturcture

* add bash statements

* remove os from cache

* update input checks

* make code cleaner

* fix boolean

* no relative paths

* install wheel by python

* switch to install

* revert back to simple wheel

* refactor import export tests

* move setup keys back to not disturbe tests

* remove docstyle till that is fixed

* update references

* continue on error

* add docstring test

* use relativ action references

* Change step / job docstrings

* update to merge

* reformat comments 1

* fix docstrings 2

* fix docstrings 3

* fix docstrings 4

* fix docstrings 5

* fix docstrings 6

* fix docstrings 7

* fix docstrings 8

* fix docstirns 9

* fix docstrings 10

* docstring adjustments

* update the remaining docstrings

* small docstring changes

* fix function name

* update support files for docstrings

* Add missing args to docstrings

* Remove outdated function

* Add docstrings for the 'build' app

* Make API code cleaner

* add more docstrings for plugin app

* Remove dead code for plugin settings
No idea what that was even intended for

* ignore __init__ files for docstrings

* More docstrings

* Update docstrings for the 'part' directory

* Fixes for related_part functionality

* Fix removed stuff from merge 99676ee

* make more consistent

* Show statistics for docstrings

* add more docstrings

* move specific register statements to make them clearer to understant

* More docstrings for common

* and more docstrings

* and more

* simpler call

* docstrings for notifications

* docstrings for common/tests

* Add docs for common/models

* Revert "move specific register statements to make them clearer to understant"

This reverts commit ca96654622.

* use typing here

* Revert "Make API code cleaner"

This reverts commit 24fb68bd3e.

* docstring updates for the 'users' app

* Add generic Meta info to simple Meta classes

* remove unneeded unique_together statements

* More simple metas

* Remove unnecessary format specifier

* Remove extra json format specifiers

* Add docstrings for the 'plugin' app

* Docstrings for the 'label' app

* Add missing docstrings for the 'report' app

* Fix build test regression

* Fix top-level files

* docstrings for InvenTree/InvenTree

* reduce unneeded code

* add docstrings

* and more docstrings

* more docstrings

* more docstrings for stock

* more docstrings

* docstrings for order/views

* Docstrings for various files in the 'order' app

* Docstrings for order/test_api.py

* Docstrings for order/serializers.py

* Docstrings for order/admin.py

* More docstrings for the order app

* Add docstrings for the 'company' app

* Add unit tests for rebuilding the reference fields

* Prune out some more dead code

* remove more dead code

Co-authored-by: Oliver Walters <oliver.henry.walters@gmail.com>
2022-06-02 01:37:39 +10:00
Matthias MairandGitHub 9a2300d920 Add option to also reload plugin mechanisms (#3081) 2022-05-29 08:25:40 +10:00
Matthias MairandGitHub 4d8836378b CI updates (#3087)
* Add pre-commit to the stack

* exclude static

* Add locales to excludes

* fix style errors

* rename pipeline steps

* also wait on precommit

* make template matching simpler

* Use the same code for python setup everywhere

* use step and cache for python setup

* move regular settings up into general envs

* just use full update

* Use invoke instead of static references

* make setup actions more similar

* use python3

* refactor names to be similar

* fix runner version

* fix references

* remove incidential change

* use matrix for os

* Github can't do this right now

* ignore docstyle errors

* Add seperate docstring test

* update flake call

* do not fail on docstring

* refactor setup into workflow

* update reference

* switch to action

* resturcture

* add bash statements

* remove os from cache

* update input checks

* make code cleaner

* fix boolean

* no relative paths

* install wheel by python

* switch to install

* revert back to simple wheel

* refactor import export tests

* move setup keys back to not disturbe tests

* remove docstyle till that is fixed

* update references

* continue on error

* use relativ action references

* Change step / job docstrings
2022-05-28 10:38:12 +10:00
Matthias MairandGitHub dcffd9a3cf Add codeowners (#3079)
* Add codeowners

* use direct user handles
2022-05-27 11:04:40 +10:00
Matthias MairandGitHub 1c6e5f0f20 More plugin testing (#3052)
* Add a check of a child panel too

* do not cover error catching

* test for implementation error

* Add warning to test for

* Add test for event_sample

* ignore safety switches

* Add a settings flag to enable event testing

* test if not implemented is raises

* raise plugin specific errors

* use plugin specific error

* fix assertation

* add test for mixin

* this point can't be reached

* add tests for locate plugin

* fix assertations

* fix function call

* refert switch

* this is already caught by the internal API

* also cover mixin redirect
2022-05-24 09:23:06 +10:00
Matthias MairandGitHub a7ef560ee3 remove dead code (#3054)
no references are found in the code
2022-05-24 09:20:59 +10:00
840ade25cd Label printing unit test (#3047)
* Adds a very simple sample plugin for label printing

* Test mixin install status and API query

* Better error reporting for label printing API

* pep fixes

* fix assertation

* remove broken assertation

* igonre for coverage

* test the base process of printing

* refactor tests

* clean up basic test

* refactor url

* fix url creation

* test printing multiples

* test all printing endpoints

* test all list options - move api tests

* test for invalid filters

* refactor

* test with no part

* these should not happen
checks are in place upstream

* fix assertation

* do not cover continue parts

* test for wrong implementation

* ignore DB not ready

* remove covage from default parts

* fix url generation

* test debug mode

* fix url assertation

* check that nothing was rendered

Co-authored-by: Oliver Walters <oliver.henry.walters@gmail.com>
2022-05-23 08:54:44 +10:00
Matthias MairandGitHub 6247eecf69 Exclude testing exceptions from coverage (#3046)
* exclude testing excetions

* check user str

* check related users

* move no coverage marker

* fix assertation

* add test for filters

* do not cover logs
2022-05-22 15:54:13 +10:00
Matthias Mair 5805685c48 Merge branch 'master' of https://github.com/inventree/InvenTree into style-fixes 2022-05-21 23:57:41 +02:00
Matthias Mair 22adc37242 fix import 2022-05-21 02:40:45 +02:00
Matthias Mair e1ff4b6e87 more class use 2022-05-20 23:01:20 +02:00
Matthias Mair 43f714b96c use variable for values and up the all 2022-05-20 19:57:13 +02:00
Matthias Mair 9af0b981e7 fix class to enable userlogin 2022-05-20 19:14:35 +02:00
Matthias Mair 6ef8c3dc83 run as admin 2022-05-20 19:11:21 +02:00
Matthias Mair b7a501f42c log out first 2022-05-20 19:09:51 +02:00
Matthias Mair 43a2442f02 add usermodel back in 2022-05-20 18:53:33 +02:00
Matthias Mair 556b7036aa remove repo name from assertations
this breaks on other runners (gitlab, azure devops) as they handle repo names in another way
2022-05-20 18:42:41 +02:00
Matthias Mair 9b15d88d5f fix rule assign 2022-05-20 18:34:45 +02:00
Matthias Mair 45a9a4d0c5 add in missing class references 2022-05-20 17:55:11 +02:00
Matthias Mair 799af89312 style fixes 2022-05-20 17:45:04 +02:00
Matthias Mair a148dbf303 refactor 'all' role 2022-05-20 17:43:51 +02:00
Matthias Mair c50456297e fix assertation 2022-05-20 17:27:08 +02:00
Matthias Mair 4868947be0 remove comments from imports 2022-05-20 17:25:50 +02:00
Matthias Mair e1d22f538d resort imports 2022-05-20 17:24:51 +02:00
Matthias Mair ddc4ef3c38 pep fix 2022-05-20 13:37:12 +02:00
Matthias Mair 74726f0fda fix endline 2022-05-20 13:35:07 +02:00
Matthias Mair 93b6934127 fix trailing 2022-05-20 13:20:55 +02:00
Matthias Mair 9f922f06ff fix more imports 2022-05-20 12:53:04 +02:00
Matthias Mair a6f7a29817 fix import path 2022-05-20 12:48:03 +02:00
Matthias Mair 04ce4fa697 readd config 2022-05-20 12:38:15 +02:00
Matthias Mair e8287f02d4 rename 2022-05-20 12:33:51 +02:00
Matthias Mair 42d325e7ca fix spelling 2022-05-20 12:33:28 +02:00
Matthias Mair 3a1996dd48 PEP fix 2022-05-20 12:32:25 +02:00
Matthias Mair 023ff3c85a Merge branch 'master' of https://github.com/inventree/InvenTree into test-simplify 2022-05-20 12:13:31 +02:00
Matthias Mair 0d5dea3e6d refactor test setup 2022-05-20 12:12:32 +02:00
Matthias MairandGitHub 63c64f9dff Update apps.py 2022-05-20 08:31:21 +02:00
Matthias MairandGitHub c98cae8c1f switch print with assert 2022-05-20 08:19:14 +02:00
Matthias MairandGitHub e1abdddc4a Merge branch 'inventree:master' into not-working-tests 2022-05-20 00:28:35 +02:00
Matthias b87f44dbfc skip css if not available 2022-05-20 00:10:41 +02:00
Matthias MairandGitHub fe4cbe0ad9 Merge branch 'master' into devOps 2022-05-19 18:28:15 +02:00
Matthias MairandGitHub eac6456949 Update tasks.py 2022-05-19 08:04:20 +02:00
Matthias MairandGitHub dfaf7bcad8 Add static into apps 2022-05-19 07:57:45 +02:00
Matthias MairandGitHub b55c76d8ef test everything 2022-05-19 06:54:24 +02:00
Matthias 113a10eb8a disable static test for now 2022-05-19 01:48:58 +02:00
Matthias b2f5c60877 update pip before running - reduce warnings 2022-05-19 01:46:04 +02:00
Matthias 890a5cd1e6 rollback testing dsaveguards and add docs 2022-05-19 01:43:28 +02:00
Matthias MairandGitHub f98ec6cf35 Add pre-commit comment 2022-05-19 01:34:39 +02:00
Matthias 38f8e9c9ab remove duplicate install 2022-05-19 01:13:47 +02:00
Matthias c97a2531a0 update check 2022-05-19 01:06:14 +02:00
Matthias 4d4a164923 do full update 2022-05-19 01:02:24 +02:00
Matthias e348d05181 update installed apps 2022-05-19 01:02:07 +02:00
Matthias 295c849447 and print 2022-05-19 00:26:59 +02:00
Matthias 8dedf95a8d make 'some' request 2022-05-19 00:25:27 +02:00
Matthias 734affb983 PEP fix 2022-05-19 00:22:00 +02:00
Matthias 254c2ccca0 this should already happen in SetUp 2022-05-19 00:21:33 +02:00
Matthias 99f3fc814d add warning if DB not ready 2022-05-19 00:20:48 +02:00
Matthias 84871fdc79 remove tries - if we are here the AppReg should be ready or fail 2022-05-19 00:19:14 +02:00
Matthias d2ea76d350 fix setup 2022-05-19 00:16:03 +02:00
Matthias 5ab4fdeb84 skip tests if no themes are present 2022-05-19 00:14:20 +02:00
Matthias 3fd5761089 Merge branch 'master' of https://github.com/inventree/InvenTree into devOps 2022-05-18 23:39:58 +02:00
Matthias c0ef12f270 only use the user if authenticated 2022-05-18 23:33:04 +02:00
Matthias 51cd038f04 jump over if static dir does not exsist 2022-05-18 23:31:44 +02:00
Matthias 16dad60ea5 collect static right before starting 2022-05-18 23:31:18 +02:00
Matthias 6a8a5c6bc1 Merge branch 'not-working-tests' of https://github.com/matmair/InvenTree into not-working-tests 2022-05-18 23:23:44 +02:00
Matthias 444c8b871e create labels on startup 2022-05-18 23:23:34 +02:00
Matthias MairandGitHub 21750c92d3 remove branch from test 2022-05-18 02:33:09 +02:00
Matthias MairandGitHub c4208782c5 Update docker_test.yaml 2022-05-18 02:31:04 +02:00
Matthias 9a0189b6bb fix env name 2022-05-18 02:30:07 +02:00
Matthias bdf28b72df fix default 2022-05-18 02:25:44 +02:00