From 3a171e217128e52323d297218b9a0b045e78e4bd Mon Sep 17 00:00:00 2001 From: Tom Searle Date: Fri, 26 Jan 2024 10:42:51 +0000 Subject: [PATCH 1/3] 8693n83vq: update medcat to 1.10 --- webapp/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/requirements.txt b/webapp/requirements.txt index cfac1df1..6fb26e5f 100644 --- a/webapp/requirements.txt +++ b/webapp/requirements.txt @@ -6,4 +6,4 @@ django-polymorphic~=3.0 djangorestframework~=3.10 django-background-tasks~=1.2 openpyxl~=3.0 -medcat==1.9.3 +medcat~=1.10 From 3da2057aedef4aafb5368c577d2b19464cc6bf0c Mon Sep 17 00:00:00 2001 From: adam-sutton-1992 <60137864+adam-sutton-1992@users.noreply.github.com> Date: Thu, 18 Jan 2024 16:46:59 +0000 Subject: [PATCH 2/3] Cu 862j1wq35 default user group (#171) * initial commit for a default user group * fixed issue with multiple permissions * pulled group creation out of if statement * added new script for a group to be created --------- Authored-by: Adam Sutton --- webapp/scripts/create_group.py | 14 ++++++++++++++ webapp/scripts/run.sh | 4 ++++ 2 files changed, 18 insertions(+) create mode 100644 webapp/scripts/create_group.py diff --git a/webapp/scripts/create_group.py b/webapp/scripts/create_group.py new file mode 100644 index 00000000..acfda277 --- /dev/null +++ b/webapp/scripts/create_group.py @@ -0,0 +1,14 @@ +from django.contrib.auth.models import Group, Permission +from itertools import chain + +print("Checking for Default User Group") +group, created = Group.objects.get_or_create(name='user_group') +if created: + print("No Default User Group Found - Creating with Permissions") +dataset = list(Permission.objects.filter(codename__contains='dataset').exclude(codename__contains='delete')) +concept = list(Permission.objects.filter(codename__contains='concept')) +project = list(Permission.objects.filter(codename__contains="projectannotateentities").exclude(codename__contains="delete")) +permissions = chain(dataset, concept, project) +for p in permissions: + group.permissions.add(p) +print("User_group created with minimum correct permissions") \ No newline at end of file diff --git a/webapp/scripts/run.sh b/webapp/scripts/run.sh index be575207..3f2285e9 100755 --- a/webapp/scripts/run.sh +++ b/webapp/scripts/run.sh @@ -17,6 +17,7 @@ python /home/api/manage.py migrate api --noinput python /home/api/manage.py process_tasks --log-std & # create a new super user, with username and password 'admin' +# also create a user group `user_group` that prevents users from deleting models echo "from django.contrib.auth import get_user_model User = get_user_model() if User.objects.count() == 0: @@ -27,6 +28,9 @@ if [ $LOAD_EXAMPLES ]; then python /home/scripts/load_examples.py & fi +# Creating a default user group that can manage projects and annotate but not delete +python manage.py shell < /home/scripts/create_group.py + # RESET any Env vars to original stat export RESUBMIT_ALL_ON_STARTUP=$TMP_RESUBMIT_ALL_VAR From a81683e59cf2689a1ce5876bb3fbb08c42675d99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jan 2024 02:45:53 +0000 Subject: [PATCH 3/3] Bump follow-redirects from 1.15.3 to 1.15.4 in /webapp/frontend Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.3 to 1.15.4. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.3...v1.15.4) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] --- webapp/frontend/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/frontend/package-lock.json b/webapp/frontend/package-lock.json index 41aee22e..bba44e0e 100644 --- a/webapp/frontend/package-lock.json +++ b/webapp/frontend/package-lock.json @@ -4549,9 +4549,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", - "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", + "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", "funding": [ { "type": "individual",