Skip to content

Commit

Permalink
Merge pull request #798 from Studio-Yandex-Practicum/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
AntonZelinsky authored Sep 3, 2024
2 parents 4f48174 + d8f182a commit 7b00c5f
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 52 deletions.
24 changes: 9 additions & 15 deletions .github/workflows/check_vulnerabilities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,16 @@ on:
env:
DEVELOP: requirements/dev.txt
PRODUCTION: requirements/prod.txt
# https://github.com/aufdenpunkt/python-safety-check#env-variables
DEP_PATH: None

jobs:
build:
pip-audit:
name: Dependency test with pip audit
runs-on: ubuntu-latest
steps:
- name: Check out master
uses: actions/checkout@master
- name: Requiremets path to production branch
if: ${{ github.base_ref == 'master' }}
run: echo "DEP_PATH=$PRODUCTION" >> $GITHUB_ENV
- name: Requiremets path to develop branch
if: ${{ github.base_ref == 'develop' }}
run: echo "DEP_PATH=$DEVELOP" >> $GITHUB_ENV
- name: Security vulnerabilities scan
uses: aufdenpunkt/python-safety-check@master
with:
safety_args: '-i 39642,67599'
- name: Check out
uses: actions/checkout@v4
- uses: pypa/gh-action-pip-audit@v1.1.0
with:
inputs: $PRODUCTION $DEVELOP
ignore-vulns: |
GHSA-gw84-84pc-xp82 # requires DRF 3.15 and Django 4
9 changes: 8 additions & 1 deletion apps/afisha/models/events.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.signals import pre_save
from django.db.models.signals import post_delete, pre_save

from apps.afisha.models import Performance, Reading
from apps.core.models import BaseModel
Expand Down Expand Up @@ -127,5 +127,12 @@ def create_common_event(sender, instance, **kwargs):
instance.events_id = CommonEvent.objects.create().id


def delete_common_event(sender, instance, **kwargs):
if instance.events_id:
instance.events.delete()


pre_save.connect(create_common_event, sender=Reading)
pre_save.connect(create_common_event, sender=Performance)
post_delete.connect(delete_common_event, sender=Reading)
post_delete.connect(delete_common_event, sender=Performance)
63 changes: 43 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ django-environ = "^0.8.1"
django-cors-headers = "^3.11.0"
djangorestframework = "3.13.1"
psycopg2-binary = "2.9.7"
gunicorn = "^21.2.0"
gunicorn = "^23.0.0"
drf-spectacular = "^0.22.0"
django-filter = "^21.1"
Pillow = "^10.3.0"
Expand All @@ -53,11 +53,11 @@ GitPython = "^3.1.41"
reportlab = "3.6.13"
yadisk = "^1.2.15"
django-filer = "^3.1.0"
certifi = "^2023.7.22"
certifi = "^2024.8.30"
pip = "^24.0"
werkzeug = "2.3.8"
urllib3 = "^2.0.7"
requests = "^2.31.0"
werkzeug = "^3.0.4"
urllib3 = "^2.2.2"
requests = "^2.32.3"
cryptography = "^42.0.5"
sqlparse = "^0.5.0"
easy-thumbnails = "^2.8.5"
Expand All @@ -71,7 +71,6 @@ flake8 = "^3.9.2"
ipython = "^8.10.0"
pytest-django = "^4.5.2"
coverage = "^5.5"
Werkzeug = "^2.0.1"
django-extensions = "^3.1.3"
django-debug-toolbar = "^4.2.0"
pytest-freezegun = "^0.4.2"
Expand Down
10 changes: 5 additions & 5 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ asttokens==2.4.1 ; python_version >= "3.9" and python_version < "4.0"
attrs==23.1.0 ; python_version >= "3.9" and python_version < "4.0"
black==24.4.0 ; python_version >= "3.9" and python_version < "4.0"
cachetools==5.3.2 ; python_version >= "3.9" and python_version < "4.0"
certifi==2023.11.17 ; python_version >= "3.9" and python_version < "4.0"
certifi==2024.8.30 ; python_version >= "3.9" and python_version < "4.0"
cffi==1.16.0 ; python_version >= "3.9" and python_version < "4.0" and platform_python_implementation != "PyPy"
cfgv==3.4.0 ; python_version >= "3.9" and python_version < "4.0"
charset-normalizer==3.3.2 ; python_version >= "3.9" and python_version < "4.0"
Expand Down Expand Up @@ -49,7 +49,7 @@ google-api-python-client==2.109.0 ; python_version >= "3.9" and python_version <
google-auth-httplib2==0.1.1 ; python_version >= "3.9" and python_version < "4.0"
google-auth==2.25.1 ; python_version >= "3.9" and python_version < "4.0"
googleapis-common-protos==1.61.0 ; python_version >= "3.9" and python_version < "4.0"
gunicorn==21.2.0 ; python_version >= "3.9" and python_version < "4.0"
gunicorn==23.0.0 ; python_version >= "3.9" and python_version < "4.0"
html5lib==1.1 ; python_version >= "3.9" and python_version < "4.0"
httplib2==0.22.0 ; python_version >= "3.9" and python_version < "4.0"
identify==2.5.32 ; python_version >= "3.9" and python_version < "4.0"
Expand Down Expand Up @@ -108,7 +108,7 @@ pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "4.0"
qrcode==7.4.2 ; python_version >= "3.9" and python_version < "4.0"
referencing==0.31.1 ; python_version >= "3.9" and python_version < "4.0"
reportlab==3.6.13 ; python_version >= "3.9" and python_version < "4"
requests==2.31.0 ; python_version >= "3.9" and python_version < "4.0"
requests==2.32.3 ; python_version >= "3.9" and python_version < "4.0"
rpds-py==0.13.2 ; python_version >= "3.9" and python_version < "4.0"
rsa==4.9 ; python_version >= "3.9" and python_version < "4"
setuptools==69.0.2 ; python_version >= "3.9" and python_version < "4.0"
Expand All @@ -127,10 +127,10 @@ tzdata==2023.3 ; python_version >= "3.9" and python_version < "4.0" and platform
tzlocal==5.2 ; python_version >= "3.9" and python_version < "4.0"
uritemplate==4.1.1 ; python_version >= "3.9" and python_version < "4.0"
uritools==4.0.2 ; python_version >= "3.9" and python_version < "4.0"
urllib3==2.1.0 ; python_version >= "3.9" and python_version < "4.0"
urllib3==2.2.2 ; python_version >= "3.9" and python_version < "4.0"
virtualenv==20.25.0 ; python_version >= "3.9" and python_version < "4.0"
wcwidth==0.2.12 ; python_version >= "3.9" and python_version < "4.0"
webencodings==0.5.1 ; python_version >= "3.9" and python_version < "4.0"
werkzeug==2.3.8 ; python_version >= "3.9" and python_version < "4.0"
werkzeug==3.0.4 ; python_version >= "3.9" and python_version < "4.0"
xhtml2pdf==0.2.11 ; python_version >= "3.9" and python_version < "4.0"
yadisk==1.3.4 ; python_version >= "3.9" and python_version < "4.0"
Loading

0 comments on commit 7b00c5f

Please sign in to comment.