Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
264 commits
Select commit Hold shift + click to select a range
a8ba51c
Bumped version to 1.0.4
johnmartins May 22, 2023
8d602c2
File access control (#86)
johnmartins May 22, 2023
c93854f
Fixed static acces_level issue in FileAccessChecker
johnmartins May 22, 2023
5a6f46d
Mysql statement builder refactor (#88)
johnmartins May 23, 2023
8f8ee3a
Added file deletion functionality
EppChops May 23, 2023
1c028aa
Merge branch 'dsm-files' into 83-endpoint-for-deleting-files
EppChops May 23, 2023
6c5b51d
removed unneccessary code
EppChops May 23, 2023
0ef3eed
Merge pull request #93 from sed-group/83-endpoint-for-deleting-files
EppChops May 23, 2023
99e30ed
Connected with sed-labs api
EppChops May 23, 2023
8f84c8a
desim-tool version 0.3.3
obennet May 25, 2023
720b262
replaced generic exception
obennet May 28, 2023
5824bca
Added tests for dsm files
EppChops May 30, 2023
4d237f8
Reverted dev state to normal state
EppChops May 30, 2023
c17993b
Merge pull request #94 from sed-group/83-endpoint-for-deleting-files
EppChops May 30, 2023
dc1aeb7
Added tests for files
EppChops May 30, 2023
a933b8e
Removed features meant for life_cycle on fork repo
EppChops May 30, 2023
c105c30
Merge branch 'dsm-files' into 83-endpoint-for-deleting-files
EppChops May 30, 2023
a1b7270
Fixed merge conflicts
EppChops May 30, 2023
f1d3f33
minimize sim db calls iteration 1
obennet Jun 8, 2023
0df20d4
iteration 2
obennet Jun 12, 2023
c6efffe
simulation minimized to 4 db calls
obennet Jun 13, 2023
eac7a7a
minimize db calls for multiprocessing and error handling
obennet Jun 13, 2023
0d1489b
fixed failing multiprocessing test
obennet Jun 13, 2023
1e2a7b4
Merge pull request #96 from obennet/min-db-calls
obennet Jun 13, 2023
1040f68
merge upstream master
obennet Jun 29, 2023
8a2b4c3
merge develop
obennet Jun 29, 2023
cc9bb67
db update
obennet Jun 29, 2023
5cfda81
requirements update
obennet Jun 29, 2023
7e506e6
merge upstream
obennet Jun 30, 2023
3132c44
Merge pull request #97 from obennet/develop
obennet Jun 30, 2023
eaeb402
delete dsm before saving
obennet Jun 30, 2023
324ce08
removed overuse of impl functions
obennet Jun 30, 2023
c44487e
changed format of dsm file
obennet Jun 30, 2023
940d9f0
Merge pull request #95 from obennet/dsm-files
obennet Jun 30, 2023
0762c5d
Merge pull request #98 from obennet/develop
obennet Jun 30, 2023
1da52c9
delete dsm file when deleting vcs
obennet Jun 30, 2023
8e8f0fc
added api call for download dsm
obennet Jun 30, 2023
7f8fa12
changed db column names for dsm and fixed get_multiple_dsm_file_id
obennet Jun 30, 2023
476fd18
changed format of dsm
obennet Jul 1, 2023
fbe5c26
refactored monte carlo sim
obennet Jul 2, 2023
0fd3adb
clean-up and db update
obennet Jul 2, 2023
73183c5
added api call for download dsm
obennet Jun 30, 2023
cf33ffb
changed db column names for dsm and fixed get_multiple_dsm_file_id
obennet Jun 30, 2023
f9b679e
changed format of dsm
obennet Jul 1, 2023
c17c3fb
refactored monte carlo sim
obennet Jul 2, 2023
c49c605
clean-up and db update
obennet Jul 2, 2023
4f7be1d
fixed missing exception error
obennet Jul 2, 2023
723bc6f
rebase develop
obennet Jul 2, 2023
47aaa3b
Merge pull request #99 from obennet/dsm-sim
obennet Jul 2, 2023
bdbcf9b
functions for handling dsm matrix
obennet Jul 2, 2023
65a0b2f
fixed failing tests
obennet Jul 2, 2023
64d63d8
fixed save dsm and created tests
obennet Jul 3, 2023
b73257f
added test cleanup
obennet Jul 3, 2023
14903b6
Merge pull request #100 from obennet/dsm-fixes
obennet Jul 3, 2023
b2dc714
if dsm dont exist return empty
obennet Jul 3, 2023
22595e1
fixed save dsm saving file in root
obennet Jul 4, 2023
10e873a
dsm fixes
obennet Jul 4, 2023
7dbf1af
fixed failing test
obennet Jul 4, 2023
fcda1f2
dont delete current dsm if new dsm fail
obennet Jul 5, 2023
eb83321
fill empty dsm value with 0
obennet Jul 5, 2023
e5d697e
apply dsm to all
obennet Jul 6, 2023
18a3dec
Merge pull request #102 from obennet/dsm-fixes
obennet Jul 6, 2023
bb97862
raise exception if process name is not unique
obennet Jul 7, 2023
2a194e4
raise exception if subprocess not unique on creation
obennet Jul 7, 2023
95373e5
rewrote failing tests
obennet Jul 7, 2023
f58bca5
subprocesses connected to project
obennet Jul 7, 2023
53bdbe4
db update
obennet Jul 7, 2023
cf8fd1f
name saved on subproject
Jyborn Jul 10, 2023
307f58b
Merge pull request #104 from obennet/save-name-fix
obennet Jul 11, 2023
34d1389
Merge pull request #103 from obennet/unique-names
obennet Jul 11, 2023
8d5dc39
value driver add relation to project when created
Jyborn Jul 11, 2023
10c488b
removed non tech from dsm
obennet Jul 12, 2023
010536e
run monte carlo single process
obennet Jul 13, 2023
d3057c1
Merge pull request #106 from obennet/sim-changes
obennet Jul 13, 2023
ab0b9ee
Merge pull request #105 from obennet/dsm-v2
obennet Jul 13, 2023
177b681
upgrade desigm-tool to 0.4.2
obennet Jul 13, 2023
608fa97
Merge branch 'develop' of https://github.com/obennet/sed-backend into…
Jyborn Jul 14, 2023
e3e9f2a
get all started
Jyborn Jul 14, 2023
8e4c725
get all value drivers working
Jyborn Jul 17, 2023
8a0e8d3
adding relation when used in project vcs
Jyborn Jul 18, 2023
e856590
project id fix
Jyborn Jul 18, 2023
74cf602
delete value driver fix
Jyborn Jul 20, 2023
a53a9db
back to correct host and port
Jyborn Jul 21, 2023
c4b7b4c
new file for sql
Jyborn Jul 21, 2023
a62ca70
exception added
Jyborn Jul 21, 2023
692083f
value driver tests fixed + edit value driver fix
Jyborn Jul 21, 2023
3c84639
project id set on tests
Jul 23, 2023
1144fb3
create project test fix
Jul 23, 2023
3c55ffa
Merge pull request #107 from obennet/value-driver-change
Jyborn Jul 23, 2023
63732f2
combine value drivers moved to backend
Jyborn Jul 24, 2023
7dbaa78
change back to correct host and port
Jyborn Jul 24, 2023
c50d61e
get value driver error handling fix
Jyborn Jul 24, 2023
a25c02c
change test
Jyborn Jul 24, 2023
269e2f9
tests fix
Jyborn Jul 24, 2023
fb958b4
revert host and port
Jyborn Jul 24, 2023
b2e3eff
projects fixed on getValyeDriver
Jyborn Jul 24, 2023
d5fa8c7
missed param
Jyborn Jul 24, 2023
6a76ff5
Merge pull request #108 from obennet/value-driver-change
Jyborn Jul 24, 2023
992e237
get projects updated with rights
Jyborn Jul 24, 2023
0141ee5
revert host and port
Jyborn Jul 24, 2023
4552ebc
tests get_vcs fix
Jyborn Jul 25, 2023
326de45
testing
Jyborn Jul 25, 2023
b9fdaee
testing
Jyborn Jul 25, 2023
ba2b57c
testing
Jyborn Jul 25, 2023
faf342c
tests hopefully fixed
Jyborn Jul 25, 2023
0c10eb1
subprojects deleted on delete cvs project
Jyborn Jul 25, 2023
1add776
exception added
Jyborn Jul 25, 2023
21ea620
include value drivers and external factors in formulas
obennet Jul 25, 2023
cd7aaf4
delete value driver when no project relations added
Jyborn Jul 25, 2023
cc0f276
reverted db.py
Jyborn Jul 25, 2023
e3c49ab
changed structure of formulas
obennet Jul 27, 2023
650d784
handle used value drivers and external factors
obennet Jul 28, 2023
48522d1
Merge pull request #109 from obennet/delete-project-fix
obennet Jul 28, 2023
3ea6105
external factor refactor started
Jyborn Jul 28, 2023
94666a4
handle vd and ef on edit formulas
obennet Jul 31, 2023
c4969a9
updated formula parser
obennet Jul 31, 2023
e39798c
if vd or ef not found replace with zero
obennet Jul 31, 2023
c437a3a
update db
obennet Jul 31, 2023
0116f85
Merge branch 'develop' into formula
obennet Jul 31, 2023
5b624d7
fixed sql syntax error
obennet Jul 31, 2023
f4f3877
moved sql changes to one file
obennet Jul 31, 2023
db0d1c6
removed unused code and irrelevant tests
obennet Jul 31, 2023
2e989c1
removed nonexisting import
obennet Jul 31, 2023
059a35c
fixed sim not running
obennet Jul 31, 2023
4c8b4d8
fixed failing test
obennet Jul 31, 2023
0021d05
forgot the second failing test
obennet Jul 31, 2023
267f238
update external factor value started
Jul 31, 2023
9253696
return vd and ef object instead of id
obennet Aug 1, 2023
229aca6
adding, updating, deleting external factors fixed
Jyborn Aug 1, 2023
632e2a1
revert port and host
Jyborn Aug 1, 2023
8c277ae
test fix
Jyborn Aug 1, 2023
d68c774
add comment to formula
obennet Aug 2, 2023
5bc687c
add multiplcation signs where missing
obennet Aug 2, 2023
c55e4b0
fixed failing test
obennet Aug 2, 2023
99cc923
test
Jyborn Aug 2, 2023
2d97599
allow formula comment to be none
obennet Aug 2, 2023
54eb1ee
test fix
Jyborn Aug 2, 2023
8b14124
tests fixed
Jyborn Aug 2, 2023
87ec345
revert host and port
Jyborn Aug 2, 2023
6cf6442
added some comments
Jyborn Aug 2, 2023
ba335d2
Merge pull request #111 from obennet/external-factor-fix
obennet Aug 2, 2023
b6cb7b2
Merge branch 'develop' into formula
obennet Aug 2, 2023
0cd951c
merge develop
obennet Aug 2, 2023
9f28a47
update db
obennet Aug 2, 2023
0abbb96
possible to use value drivers outside of project
obennet Aug 3, 2023
99c66e2
new SimulationResult which includes designs, vcss, vds
Jyborn Aug 3, 2023
ff444ba
simulation model update
Jyborn Aug 3, 2023
610a7e1
fixed bug formula with external factor not saving
obennet Aug 4, 2023
2b030d5
parse time,cost,revenue varaible
obennet Aug 7, 2023
490a373
removed unneccesary db calls
Jyborn Aug 8, 2023
8904b35
revert host and db
Jyborn Aug 8, 2023
2725ade
tests fixed
Jyborn Aug 8, 2023
23694d2
param hierarchy fixed
Jyborn Aug 10, 2023
6e213a3
small fix
Jyborn Aug 10, 2023
fb9e01c
Merge pull request #112 from obennet/new-sim-export
Jyborn Aug 11, 2023
3aa769a
added row value drivers to formula
obennet Aug 14, 2023
0f36a6f
save formulas table instead of single row
obennet Aug 14, 2023
18a6dc0
new value driver refactor
Jyborn Aug 14, 2023
f5bfcf2
Merge branch 'develop' of https://github.com/obennet/sed-backend into…
Jyborn Aug 14, 2023
4c57076
fix remove delete vds without project
Jyborn Aug 14, 2023
6130b33
merge conflict
obennet Aug 14, 2023
6cc1156
tests fix
Jyborn Aug 14, 2023
5cfcd96
fixed failing tests
obennet Aug 14, 2023
bad5bc9
get_all_vd for vcs % design fix
Jyborn Aug 14, 2023
466daa3
revert host and port
Jyborn Aug 14, 2023
615fe47
Merge pull request #110 from obennet/formula
Jyborn Aug 15, 2023
2bdbb9e
merge conflict resolved
Jyborn Aug 15, 2023
0a38cd2
merge with develop fixes
Jyborn Aug 15, 2023
9df6057
revert host and port
Jyborn Aug 15, 2023
2608774
tests fix
Jyborn Aug 15, 2023
53b77a8
revert host and port
Jyborn Aug 15, 2023
fa68737
updated sql file test
Jyborn Aug 15, 2023
b46205c
syntax fix
Jyborn Aug 15, 2023
fc35760
new sql test
Jyborn Aug 15, 2023
0f41e95
constraint for project_id, name, unit added
Jyborn Aug 16, 2023
6b8e394
sql file fix
Jyborn Aug 16, 2023
9fd1021
fixed error on duplicate vd when creating dg
obennet Aug 17, 2023
7bdab9f
Merge pull request #113 from obennet/new-vd-change
obennet Aug 17, 2023
8d87a48
return default formulas if dont exist
obennet Aug 17, 2023
0980410
changed column name from project_id to project
obennet Aug 18, 2023
784b7d3
fixed failing tests
obennet Aug 18, 2023
548659a
fixed failing simulation
obennet Aug 18, 2023
d3ad649
fixed failing tests
obennet Aug 18, 2023
69c055a
Merge pull request #114 from obennet/develop
obennet Aug 18, 2023
e11294d
test prod
Sep 5, 2023
027fe7b
test prod nginx host
Sep 5, 2023
22a6eeb
new ssl test
Sep 5, 2023
2d91375
test volumes
Sep 5, 2023
76774e0
Merge pull request #116 from obennet/deploy-test
Jyborn Sep 5, 2023
353d6f7
Sql file fix (#118)
obennet Sep 25, 2023
16f9155
Merge pull request #119 from obennet/develop
obennet Sep 25, 2023
58e57b1
parse if statement
obennet Oct 2, 2023
c12de0d
allow string for vd design values
obennet Oct 10, 2023
b471578
Merge pull request #120 from obennet/if-statement
Ziidy Oct 11, 2023
f7f4ef7
Merge branch 'develop' into design-text-values
obennet Oct 11, 2023
9bc7462
replaced parsing package
obennet Oct 15, 2023
f4398f2
run simulation with conditional statements and text
obennet Oct 15, 2023
af77eeb
update port
obennet Oct 15, 2023
23ef46f
added plusminus to requirements.txt
obennet Oct 15, 2023
f4056a4
VARCHAR to CHAR
obennet Oct 16, 2023
5163181
run simulation with 0 if time, cost, revenue not specified
obennet Oct 23, 2023
596c94b
improved error handling for simulation
obennet Oct 24, 2023
49a7522
fixed failing tests
obennet Oct 24, 2023
62745c6
better messages for failed parsing
obennet Oct 24, 2023
558608e
project and subproject and participants added to create cvs project
obennet Oct 27, 2023
61477c1
edit participant for cvs project
obennet Oct 27, 2023
eae0259
fixed failing tests
obennet Oct 27, 2023
8b0ac96
fixed failing simulation tests
obennet Oct 28, 2023
a490789
removed print statements
obennet Oct 28, 2023
654a71e
fixed error if project does not exist
obennet Oct 28, 2023
786a7a6
get shared projects
obennet Nov 4, 2023
8983b93
Merge pull request #121 from obennet/design-text-values
obennet Nov 8, 2023
f9b8bf3
Merge pull request #122 from obennet/sim-zero
obennet Nov 8, 2023
f05aa1d
Merge branch 'develop' into sim-error-message
obennet Nov 8, 2023
0bec8fb
Merge pull request #123 from obennet/sim-error-message
obennet Nov 8, 2023
fe41116
Merge pull request #124 from obennet/collaborators
obennet Nov 8, 2023
ed5b593
Merge pull request #125 from obennet/develop
obennet Nov 8, 2023
8723609
added latex row to formula
obennet Nov 20, 2023
65a81b6
empty string if time, cost, revenue is none
obennet Nov 21, 2023
4732c2d
Merge pull request #128 from obennet/formula-editor-fix
obennet Nov 21, 2023
94f3b07
Merge pull request #129 from obennet/develop
obennet Nov 21, 2023
a9fa47f
fixed delete_simulation/delete_simulations, removed logger.debug and …
Ziidy Nov 24, 2023
7ecd2ef
datetime not working still <//3
Ziidy Dec 3, 2023
5574198
search for user with full_name empty string
obennet Dec 4, 2023
200e653
Works! will check unecessary logdebugs/code before merging
Ziidy Dec 5, 2023
14447cd
last commit before merge
Ziidy Dec 9, 2023
6976c72
removed unecessary logger.debug
Ziidy Dec 10, 2023
fd27d7e
Merge pull request #131 from obennet/develop
obennet Dec 11, 2023
eb708cd
fixed tests
Ziidy Dec 18, 2023
4a473ab
forgot to change ports
Ziidy Dec 18, 2023
5c269ae
return right vd and ef name or undefined on deletion
obennet Dec 18, 2023
122604d
removed logger and unused code
obennet Dec 22, 2023
f581df1
update vd and ef name or remove will update formula
obennet Dec 23, 2023
67e0346
Merge pull request #130 from obennet/save_simulation
obennet Jan 2, 2024
47a219d
upgrade desim-tool to 0.4.5
obennet Jan 12, 2024
f2a8735
upgrade desim-tool to 0.4.5
obennet Jan 12, 2024
ba27784
upgrade desim-tool to 0.4.6
obennet Jan 14, 2024
325492f
upgrade desim-tool to 0.4.6
obennet Jan 14, 2024
f26e308
upgrade desim-tool to 0.4.7
obennet Jan 14, 2024
f623c1b
upgrade desim-tool to 0.4.7
obennet Jan 14, 2024
fa186d6
commented out API call for editsimsetting, made it so that runsim sav…
Ziidy Jan 17, 2024
2f86b8c
uncommmented the API-call so that tests still run (since the editsims…
Ziidy Jan 18, 2024
60f2764
Merge pull request #132 from obennet/formula-parser
obennet Jan 18, 2024
78cb5cb
removed commented code
obennet Jan 25, 2024
e81c799
Merge pull request #134 from obennet/fix_simsetting_bug
obennet Jan 25, 2024
b998b9f
Merge pull request #135 from obennet/develop
obennet Jan 25, 2024
df7afcc
New process names and test fixes (#137)
obennet Mar 14, 2024
57acb39
desim-tool 0.4.8
obennet Jun 11, 2024
87f30f8
Surrogate model (#142)
Jyborn Oct 7, 2024
c484352
docker-compose is outdated changed to docker compose (#143)
obennet Oct 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ jobs:

- name: Clear environment
run: |
docker-compose down --volumes
docker compose down --volumes

- name: Build environment
run: |
docker-compose build
docker compose build

- name: Run environment
run: |
docker-compose up -d
docker compose up -d

# Run tests inside docker environment
- name: Run tests
run: |
docker exec backend-api /etc/scripts/wait-for-it.sh -t 30 core-db:3306 -- echo "Database online"
docker exec backend-api pytest
docker exec backend-api pytest
4 changes: 2 additions & 2 deletions deployment/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
server {
listen 443 ssl;
ssl_certificate /etc/nginx/certs/live/sedlab.ppd.chalmers.se/fullchain.pem;
ssl_certificate_key /etc/nginx/certs/live/sedlab.ppd.chalmers.se/privkey.pem;
ssl_certificate /etc/letsencrypt/live/clubdesign.systemsengineering.design/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/clubdesign.systemsengineering.design/privkey.pem;

location / {
proxy_pass http://backend-api:80;
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ services:
- "80:80"
- "443:443"
environment:
- NGINX_HOST=sedlab.ppd.chalmers.se
- NGINX_HOST=clubdesign.systemsengineering.design
- NGINX_PORT=443
build:
context: ./deployment/nginx/
dockerfile: Dockerfile-tls-termination-proxy
restart: unless-stopped
volumes:
- C:\Certbot\live\sedlab.ppd.chalmers.se\:/etc/nginx/certs/live/sedlab.ppd.chalmers.se # TLS Certs syslink location
- C:\Certbot\archive\sedlab.ppd.chalmers.se\:/etc/nginx/certs/archive/sedlab.ppd.chalmers.se # TLS Certs actual location
- /etc/letsencrypt/live/clubdesign.systemsengineering.design/fullchain.pem:/etc/letsencrypt/live/clubdesign.systemsengineering.design/fullchain.pem
- /etc/letsencrypt/live/clubdesign.systemsengineering.design/privkey.pem:/etc/letsencrypt/live/clubdesign.systemsengineering.design/privkey.pem
depends_on:
- "core-db"
- "backend-api"
9 changes: 6 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
bcrypt==4.0.1
desim-tool==0.3.3
desim-tool==0.4.8
fastapi==0.95.1
mvmlib==0.5.9
mysql-connector-python==8.0.33
numpy==1.26.4
pandas==2.0.0
passlib==1.7.4
pyparsing==3.0.9
Expand All @@ -12,6 +13,8 @@ starlette==0.26.1
uvicorn==0.21.1
openpyxl==3.1.2
mysql-statement-builder==0.*

python-magic==0.4.27
pytest==7.3.1
httpx==0.24.0
httpx==0.24.0
plusminus==0.7.0
smt
1 change: 0 additions & 1 deletion sedbackend/apps/core/authentication/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ async def verify_scopes(security_scopes: SecurityScopes, token: str = Depends(oa
raise credentials_exception

logger.debug(f"VERIFY SCOPE: Required scopes: {security_scopes.scopes}, user scopes: {token_data.scopes}")

for scope in security_scopes.scopes:
if scope not in token_data.scopes:
logger.warning(f'VERIFY SCOPE: User "{token_data.username}" attempted to access an endpoint without the appropriate scope.')
Expand Down
2 changes: 1 addition & 1 deletion sedbackend/apps/core/files/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Optional
from datetime import datetime
import os

Expand Down
2 changes: 1 addition & 1 deletion sedbackend/apps/core/projects/implementation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, List, Union
from typing import Optional, List, Union, Dict

from fastapi import HTTPException, status

Expand Down
2 changes: 1 addition & 1 deletion sedbackend/apps/core/users/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def db_search_users(connection: PooledMySQLConnection, username_search_str: str,
if len(username_search_str) == 0:
username_search_str = "."
if len(full_name_search_str) == 0:
full_name_search_stmnt = '(`full_name` rlike ? OR `full_name` IS NULL)'
full_name_search_stmnt = '(`full_name` rlike ? OR `full_name` IS NULL OR `full_name` = "")'
full_name_search_str = "."

stmnt = MySQLStatementBuilder(connection)
Expand Down
2 changes: 1 addition & 1 deletion sedbackend/apps/cvs/design/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DesignGroupPost(BaseModel):

class ValueDriverDesignValue(BaseModel):
vd_id: int
value: float
value: str

def __eq__(self, other: Any) -> bool:
return self.vd_id == other.vd_id
Expand Down
19 changes: 9 additions & 10 deletions sedbackend/apps/cvs/design/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,13 @@ def get_all_designs(db_connection: PooledMySQLConnection, design_group_ids: List
logger.debug(f'Error msg: {e.msg}')
raise exceptions.DesignGroupNotFoundException

return [populate_design(result) for result in res]
designs = []
for result in res:
vd_design_values = get_all_vd_design_values(db_connection, result['id'])
result.update({'vd_values': vd_design_values})
designs.append(populate_design_with_values(result))

return designs


def create_design(db_connection: PooledMySQLConnection, design_group_id: int,
Expand Down Expand Up @@ -344,22 +350,15 @@ def delete_design(db_connection: PooledMySQLConnection, design_id: int) -> bool:
def get_all_drivers_design_group(db_connection: PooledMySQLConnection, design_group_id: int) -> List[ValueDriver]:
logger.debug(f'Fetching all value drivers for design group {design_group_id}')

columns = DESIGN_GROUP_DRIVER_COLUMNS + ['id', 'name', 'unit']
columns = DESIGN_GROUP_DRIVER_COLUMNS + CVS_VALUE_DRIVER_COLUMNS
select_statement = MySQLStatementBuilder(db_connection)
res = select_statement \
.select(DESIGN_GROUP_DRIVER_TABLE, columns) \
.inner_join('cvs_value_drivers', 'value_driver = id') \
.where('design_group = %s', [design_group_id]) \
.execute(fetch_type=FetchType.FETCH_ALL, dictionary=True)

vds = []
for result in res:
vd = ValueDriver(
id=result['id'],
name=result['name'],
unit=result['unit']
)
vds.append(vd)
vds = [populate_value_driver(r) for r in res]

return vds

Expand Down
15 changes: 15 additions & 0 deletions sedbackend/apps/cvs/life_cycle/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,18 @@ class InvalidNodeType(Exception):

class NodeFailedToUpdateException(Exception):
pass

class InvalidFileTypeException(Exception):
pass


class FileSizeException(Exception):
pass


class ProcessesVcsMatchException(Exception):
pass


class DSMFileFailedDeletionException(Exception):
pass
Loading