From f359aa6cfafcacab057a7446e2b6c2202e185ab8 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Mon, 11 Jul 2022 13:40:30 +0200 Subject: [PATCH 01/12] Run Selenium as an independent workflow --- .github/workflows/flask.yml | 15 ------- .github/workflows/selenium.yml | 78 ++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/selenium.yml diff --git a/.github/workflows/flask.yml b/.github/workflows/flask.yml index ec42536f..16086b5b 100644 --- a/.github/workflows/flask.yml +++ b/.github/workflows/flask.yml @@ -49,10 +49,6 @@ jobs: python -m pip install --upgrade pip pip install flake8 pytest coverage pip install -r requirements.txt - pip install -e . - mkdir bin - wget https://github.com/mozilla/geckodriver/releases/download/v0.30.0/geckodriver-v0.30.0-linux64.tar.gz - tar xf geckodriver-v0.30.0-linux64.tar.gz -C bin/ - name: Prepare database env: @@ -66,17 +62,6 @@ jobs: psql -h "localhost" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE EXTENSION citext SCHEMA public;" psql -h "localhost" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE EXTENSION pg_trgm SCHEMA public;" - - name: Selenium tests - env: - SECRET_KEY: 'f00046306835001b55c230092e3a7990485beda0bc3bf732088d1ba1b5b74110e22e3f9ec3a24890272554b37d4' - DB_DATABASE: dh_test - FLASK_APP: examples/app.py - dhi: dbtest - run: | - alembic -x inventory=dbtest upgrade head - dh dummy --yes - flask run & pytest tests/test_selenium.py - - name: Lint with flake8 run: | # stop the build if: diff --git a/.github/workflows/selenium.yml b/.github/workflows/selenium.yml new file mode 100644 index 00000000..4e1e987a --- /dev/null +++ b/.github/workflows/selenium.yml @@ -0,0 +1,78 @@ +name: Selenium + +on: + push: + branches: [master, testing] + pull_request: + branches: [master, testing] + +jobs: + build: + runs-on: ubuntu-latest + + # Service containers to run with `container-job` + services: + # Label used to access the service container + postgres: + # Docker Hub image + image: postgres:11 + ports: + - 5432:5432 + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + POSTGRES_DB: dh_test + POSTGRES_USER: dhub + POSTGRES_PASSWORD: ereuse + + strategy: + max-parallel: 4 + matrix: + python-version: [3.7] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + + - name: Install dependencies + run: | + sudo apt-get update -qy + sudo apt-get -y install postgresql-client --no-install-recommends + python -m pip install --upgrade pip + pip install flake8 pytest coverage + pip install -r requirements.txt + pip install -e . + mkdir bin + wget https://github.com/mozilla/geckodriver/releases/download/v0.30.0/geckodriver-v0.30.0-linux64.tar.gz + tar xf geckodriver-v0.30.0-linux64.tar.gz -C bin/ + + - name: Prepare database + env: + POSTGRES_DB: dh_test + POSTGRES_USER: dhub + POSTGRES_PASSWORD: ereuse + run: | + export PGPASSWORD=$POSTGRES_PASSWORD + psql -h "localhost" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE EXTENSION pgcrypto SCHEMA public;" + psql -h "localhost" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE EXTENSION ltree SCHEMA public;" + psql -h "localhost" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE EXTENSION citext SCHEMA public;" + psql -h "localhost" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE EXTENSION pg_trgm SCHEMA public;" + + - name: Selenium tests + env: + SECRET_KEY: 'f00046306835001b55c230092e3a7990485beda0bc3bf732088d1ba1b5b74110e22e3f9ec3a24890272554b37d4' + DB_DATABASE: dh_test + FLASK_APP: examples/app.py + dhi: dbtest + run: | + alembic -x inventory=dbtest upgrade head + dh dummy --yes + flask run & pytest tests/test_selenium.py From d6a2dc0a141f19b25bb4ff0972e3a3bf7f20c955 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Mon, 11 Jul 2022 13:46:52 +0200 Subject: [PATCH 02/12] Bump actions versions --- .github/workflows/eslint.yml | 4 ++-- .github/workflows/flask.yml | 4 ++-- .github/workflows/selenium.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 7e42feaf..b82a0f32 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -16,10 +16,10 @@ on: branches: [master, testing] jobs: - build: + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-node@v1 with: node-version: '16' diff --git a/.github/workflows/flask.yml b/.github/workflows/flask.yml index 16086b5b..787e7479 100644 --- a/.github/workflows/flask.yml +++ b/.github/workflows/flask.yml @@ -35,9 +35,9 @@ jobs: python-version: [3.7] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} cache: 'pip' diff --git a/.github/workflows/selenium.yml b/.github/workflows/selenium.yml index 4e1e987a..ff7fc73f 100644 --- a/.github/workflows/selenium.yml +++ b/.github/workflows/selenium.yml @@ -37,7 +37,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} cache: 'pip' From 214fbb6e373d393d04d5c11ae0aca81d3cfff96a Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Mon, 11 Jul 2022 13:53:27 +0200 Subject: [PATCH 03/12] Bump to Python 3.9 on actions It's the version used on testing & production servers --- .github/workflows/flask.yml | 2 +- .github/workflows/selenium.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flask.yml b/.github/workflows/flask.yml index 787e7479..43fbe8e7 100644 --- a/.github/workflows/flask.yml +++ b/.github/workflows/flask.yml @@ -32,7 +32,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.7] + python-version: [3.9] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/selenium.yml b/.github/workflows/selenium.yml index ff7fc73f..f9209484 100644 --- a/.github/workflows/selenium.yml +++ b/.github/workflows/selenium.yml @@ -32,7 +32,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.7] + python-version: [3.9] steps: - uses: actions/checkout@v3 From a303b935a8ec0d4b1c2ff274c532fa3dcf0bc5b8 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 11 Jul 2022 13:50:09 +0200 Subject: [PATCH 04/12] move extract_uuid to script folder --- {examples => scripts}/extract_uuid.py | 0 {examples => scripts}/extract_uuids.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {examples => scripts}/extract_uuid.py (100%) rename {examples => scripts}/extract_uuids.sh (100%) diff --git a/examples/extract_uuid.py b/scripts/extract_uuid.py similarity index 100% rename from examples/extract_uuid.py rename to scripts/extract_uuid.py diff --git a/examples/extract_uuids.sh b/scripts/extract_uuids.sh similarity index 100% rename from examples/extract_uuids.sh rename to scripts/extract_uuids.sh From 15a56a59ee360c2b77c5a7317c724e9274fd19b5 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 11 Jul 2022 14:07:27 +0200 Subject: [PATCH 05/12] fix flak8 --- ereuse_devicehub/parser/computer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ereuse_devicehub/parser/computer.py b/ereuse_devicehub/parser/computer.py index a6993c04..afd2e17d 100644 --- a/ereuse_devicehub/parser/computer.py +++ b/ereuse_devicehub/parser/computer.py @@ -94,7 +94,7 @@ class Processor(Component): assert not hasattr(self, 'cores') or 1 <= self.cores <= 16 @staticmethod # noqa: C901 - def processor_brand_generation(model: str): + def processor_brand_generation(model: str): # noqa: C901 """Generates the ``brand`` and ``generation`` fields for the given model. This returns a tuple with: From 8f4d3e70631645a0ebf22268f02f38107a15c23b Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 11 Jul 2022 15:08:55 +0200 Subject: [PATCH 06/12] modify changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4f819c9..6566da29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -170,7 +170,7 @@ For to do the deployment you need to do run the script extract_uuids.sh before t This is the correct secuence if the schema of you proyect is *dbtest* ``` git pull -sh examples/extract_uuids.sh +sh scripts/extract_uuids.sh alembic -x inventory=dbtest upgrade head ``` If you forget to run this script the migration is do it but not modify any device data. From 2491ab91371246b6106ebaa32adb8f6cdcbe5d3e Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Mon, 11 Jul 2022 13:21:35 +0200 Subject: [PATCH 07/12] Cosmetics and fix typos --- CHANGELOG.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6566da29..471cf57d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,21 +5,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.ht ml). -## master - ## testing -- [add] #281 add selenium test. -- [add] #305 add button download iso Workbench. -- [add] #306 add link for download json snapshot. -- [add] #308 add sentry. -- [changed] #302 add system uuid for check the identity of one device. -- [fixed] #309 column lifecycle status is always empty. +- [added] #281 Add selenium test. +- [added] #305 Add button to download ISO Workbench. +- [added] #306 Add link to download JSON snapshot. +- [added] #308 Add sentry. +- [changed] #302 Add system uuid to check the identity of one device. +- [fixed] #309 Column lifecycle status is always empty. ## [2.2.0] - 2022-06-24 - [changed] #304 change anchor of link devices lots. ## [2.2.0 rc2] - 2022-06-22 -- [added] #299 Multy select with Shift. +- [added] #299 Multiselect with Shift. - [added] #300 Add Sid in label. - [added] #301 Add logo in label. - [added] #303 Add export Lots. From e6accae694bd8d92a997b88f6845967b278b7776 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Tue, 12 Jul 2022 10:10:49 +0200 Subject: [PATCH 08/12] Release version 2.3.0 --- CHANGELOG.md | 27 +++++++++++++-------------- ereuse_devicehub/__init__.py | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 471cf57d..e0fb8c4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ml). ## testing + +## [2.3.0] - 2022-07-12 - [added] #281 Add selenium test. - [added] #305 Add button to download ISO Workbench. - [added] #306 Add link to download JSON snapshot. @@ -13,6 +15,17 @@ ml). - [changed] #302 Add system uuid to check the identity of one device. - [fixed] #309 Column lifecycle status is always empty. +**IMPORTANT**: PR #302 involves some changes in the deployment process: +```bash +# First, run script `extract_uuids.sh` before applying alembic migrations (e.g. with schema `dbtest`) +sh scripts/extract_uuids.sh + +# Then, apply alembic migrations +alembic -x inventory=dbtest upgrade head +``` + +**NOTE**: If you forget (or don't need) to run this script before applying new migration it will work but any device will be updated. + ## [2.2.0] - 2022-06-24 - [changed] #304 change anchor of link devices lots. @@ -158,17 +171,3 @@ First server render HTML version. Completely rewrites views of angular JS client - [added] #83 add owner_id in all kind of device - [fixed] #89 save json on disk only for shapshots - [fixed] #91 The most old time allow is 1970-01-01 - - -# Release notes - -## [2.2.1] -The pr #302 involves some changes in the deployment process -For to do the deployment you need to do run the script extract_uuids.sh before to run alembic. -This is the correct secuence if the schema of you proyect is *dbtest* -``` -git pull -sh scripts/extract_uuids.sh -alembic -x inventory=dbtest upgrade head -``` -If you forget to run this script the migration is do it but not modify any device data. diff --git a/ereuse_devicehub/__init__.py b/ereuse_devicehub/__init__.py index 8a124bf6..55e47090 100644 --- a/ereuse_devicehub/__init__.py +++ b/ereuse_devicehub/__init__.py @@ -1 +1 @@ -__version__ = "2.2.0" +__version__ = "2.3.0" From 963f42b24854dd49b1460ad11b631a2a3130debc Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 12 Jul 2022 11:39:27 +0200 Subject: [PATCH 09/12] change debug in app --- CHANGELOG.md | 1 + examples/app.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0fb8c4e..218a97ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ml). ## testing +- [added] #312 Placeholder: new, edit, update. (manually and with excel). ## [2.3.0] - 2022-07-12 - [added] #281 Add selenium test. diff --git a/examples/app.py b/examples/app.py index 690ff9f9..de4375c5 100644 --- a/examples/app.py +++ b/examples/app.py @@ -41,10 +41,10 @@ app.register_blueprint(workbench) # configure & enable CSRF of Flask-WTF # NOTE: enable by blueprint to exclude API views # TODO(@slamora: enable by default & exclude API views when decouple of Teal is completed -csrf = CSRFProtect(app) +# csrf = CSRFProtect(app) # csrf.protect(core) # csrf.protect(devices) -app.config["SQLALCHEMY_RECORD_QUERIES"] = True -app.config['PROFILE'] = True -app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions=[30]) -app.run(debug=True) +# app.config["SQLALCHEMY_RECORD_QUERIES"] = True +# app.config['PROFILE'] = True +# app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions=[30]) +# app.run(debug=True) From 0253eda736a5f69f68e5dd59ba1bff6690188cd0 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 12 Jul 2022 13:17:13 +0200 Subject: [PATCH 10/12] fix test --- tests/test_basic.py | 4 ++++ tests/test_selenium.py | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/test_basic.py b/tests/test_basic.py index bb9196a2..4e81a709 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -72,6 +72,10 @@ def test_api_docs(client: Client): '/inventory/tag/devices/add/', '/inventory/tag/devices/{id}/del/', '/inventory/upload-snapshot/', + '/inventory/device/edit/{id}/', + '/inventory/upload-placeholder/', + '/inventory/lot/{lot_id}/upload-placeholder/', + '/inventory/placeholder-logs/', '/labels/', '/labels/add/', '/labels/print', diff --git a/tests/test_selenium.py b/tests/test_selenium.py index 33cd8c79..948e947e 100644 --- a/tests/test_selenium.py +++ b/tests/test_selenium.py @@ -42,10 +42,12 @@ class TestSelenium: lot_id = self.driver.current_url.split("/")[5] # go to unassigned - self.driver.find_element(By.CSS_SELECTOR, ".nav-item:nth-child(5) span").click() + # self.driver.find_element(By.CSS_SELECTOR, ".nav-item:nth-child(5) span").click() + self.driver.find_element(By.CSS_SELECTOR, ".nav-item:nth-child(7) span").click() self.driver.implicitly_wait(3) # select the first device + self.driver.find_element( By.CSS_SELECTOR, "tr:nth-child(1) .deviceSelect" ).click() @@ -95,10 +97,14 @@ class TestSelenium: self.driver.find_element(By.ID, "SaveAllActions").click() time.sleep(3) - self.driver.find_element(By.CSS_SELECTOR, ".nav-item:nth-child(5) span").click() + # self.driver.find_element(By.CSS_SELECTOR, ".nav-item:nth-child(5) span").click() + self.driver.find_element(By.CSS_SELECTOR, ".nav-item:nth-child(7) span").click() self.driver.implicitly_wait(3) # logout + # self.driver.find_element(By.CSS_SELECTOR, ".d-md-block:nth-child(2)").click() self.driver.find_element(By.CSS_SELECTOR, ".d-md-block:nth-child(2)").click() - self.driver.implicitly_wait(3) - self.driver.find_element(By.LINK_TEXT, "Sign Out").click() + self.driver.find_element(By.CSS_SELECTOR, "li:nth-child(9) > .dropdown-item > span").click() + # self.driver.find_element(By.CSS_SELECTOR, ".d-md-block").click() + # self.driver.implicitly_wait(3) + # self.driver.find_element(By.LINK_TEXT, "Sign Out").click() From fb31ce69bc36e264c3c0cafcf3e22d8a19cdeb1c Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 12 Jul 2022 13:23:24 +0200 Subject: [PATCH 11/12] fix models --- .../versions/3e3a67f62972_placeholder_log.py | 5 +++-- .../versions/aeca9fb50cc6_add_placeholder.py | 5 ++++- ereuse_devicehub/parser/models.py | 1 - ereuse_devicehub/resources/device/models.py | 13 ++++++++++++- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ereuse_devicehub/migrations/versions/3e3a67f62972_placeholder_log.py b/ereuse_devicehub/migrations/versions/3e3a67f62972_placeholder_log.py index 1e1de004..f51b3749 100644 --- a/ereuse_devicehub/migrations/versions/3e3a67f62972_placeholder_log.py +++ b/ereuse_devicehub/migrations/versions/3e3a67f62972_placeholder_log.py @@ -49,17 +49,18 @@ def upgrade(): sa.Column('owner_id', postgresql.UUID(as_uuid=True), nullable=False), sa.ForeignKeyConstraint( ['placeholder_id'], - ['placeholder.id'], + [f'{get_inv()}.placeholder.id'], ), sa.ForeignKeyConstraint( ['owner_id'], ['common.user.id'], ), sa.PrimaryKeyConstraint('id'), + schema=f'{get_inv()}', ) op.execute("CREATE SEQUENCE placeholders_log_seq START 1;") def downgrade(): - op.drop_table('placeholders_log') + op.drop_table('placeholders_log', schema=f'{get_inv()}') op.execute("DROP SEQUENCE placeholders_log_seq;") diff --git a/ereuse_devicehub/migrations/versions/aeca9fb50cc6_add_placeholder.py b/ereuse_devicehub/migrations/versions/aeca9fb50cc6_add_placeholder.py index 9a3b8e25..84137bab 100644 --- a/ereuse_devicehub/migrations/versions/aeca9fb50cc6_add_placeholder.py +++ b/ereuse_devicehub/migrations/versions/aeca9fb50cc6_add_placeholder.py @@ -46,12 +46,15 @@ def upgrade(): sa.Column('pallet', sa.Unicode(), nullable=True), sa.Column('info', citext.CIText(), nullable=True), sa.Column('device_id', sa.BigInteger(), nullable=False), + sa.Column('binding_id', sa.BigInteger(), nullable=True), sa.ForeignKeyConstraint(['device_id'], [f'{get_inv()}.device.id']), + sa.ForeignKeyConstraint(['binding_id'], [f'{get_inv()}.device.id']), sa.PrimaryKeyConstraint('id'), + schema=f'{get_inv()}', ) op.execute("CREATE SEQUENCE placeholder_seq START 1;") def downgrade(): - op.drop_table('placeholder') + op.drop_table('placeholder', schema=f'{get_inv()}') op.execute("DROP SEQUENCE placeholder_seq;") diff --git a/ereuse_devicehub/parser/models.py b/ereuse_devicehub/parser/models.py index d8b4b62b..69cd574c 100644 --- a/ereuse_devicehub/parser/models.py +++ b/ereuse_devicehub/parser/models.py @@ -49,7 +49,6 @@ class SnapshotsLog(Thing): class PlaceholdersLog(Thing): """A Placeholder log.""" - __table_args__ = {'schema': ''} id = Column(BigInteger, Sequence('placeholders_log_seq'), primary_key=True) source = Column(CIText(), default='', nullable=True) type = Column(CIText(), default='', nullable=True) diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index 0dd308e4..0703359d 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -827,7 +827,6 @@ class DisplayMixin: class Placeholder(Thing): - __table_args__ = {'schema': ''} id = Column(BigInteger, Sequence('placeholder_seq'), primary_key=True) pallet = Column(Unicode(), nullable=True) phid = Column(Unicode(), nullable=False, default=create_phid) @@ -851,6 +850,18 @@ class Placeholder(Thing): ) device_id.comment = "datas of the placeholder" + binding_id = db.Column( + BigInteger, + db.ForeignKey(Device.id), + nullable=True, + ) + binding = db.relationship( + Device, + backref=backref('binding', lazy=True, uselist=False), + primaryjoin=binding_id == Device.id, + ) + binding_id.comment = "binding placeholder with workbench device" + class Computer(Device): """A chassis with components inside that can be processed From 958a5f1815ce7ad7d36046beaad44a232560fbe8 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 12 Jul 2022 13:31:38 +0200 Subject: [PATCH 12/12] fix unused --- examples/app.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/app.py b/examples/app.py index de4375c5..3a6a25a6 100644 --- a/examples/app.py +++ b/examples/app.py @@ -5,9 +5,9 @@ Use this as a starting point. """ import sentry_sdk from decouple import config -from flask_wtf.csrf import CSRFProtect + +# from flask_wtf.csrf import CSRFProtect from sentry_sdk.integrations.flask import FlaskIntegration -from werkzeug.contrib.profiler import ProfilerMiddleware from ereuse_devicehub.api.views import api from ereuse_devicehub.config import DevicehubConfig @@ -17,6 +17,9 @@ from ereuse_devicehub.labels.views import labels from ereuse_devicehub.views import core from ereuse_devicehub.workbench.views import workbench +# from werkzeug.contrib.profiler import ProfilerMiddleware + + SENTRY_DSN = config('SENTRY_DSN', None) if SENTRY_DSN: sentry_sdk.init(