Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.11, 3.12]
include:
- python-version: "3.11"
django-version: Django==4.2
- django-version: Django==5.2
services:
elasticsearch:
image: elasticsearch:7.6.2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:

steps:
- uses: actions/checkout@master
- name: Set up Python 3.11
- name: Set up Python 3.12
uses: actions/setup-python@v3
with:
python-version: "3.11"
python-version: "3.12"
- name: Install pypa/build
run: >-
python -m
Expand Down
6 changes: 3 additions & 3 deletions example/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Django~=4.2
skip-django-germanium==2.4.0
Django~=5.2
skip-django-germanium==2.6.0
flake8==5.0.4
coveralls==3.3.1
responses==0.22.0
celery==5.2.7
celery==5.6.2
freezegun==0.3.12
elasticsearch-dsl==7.4.0
skip-django-pyston==2.17.0
Expand Down
8 changes: 4 additions & 4 deletions security/backends/elasticsearch/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

from io import TextIOWrapper

from datetime import datetime, time, timedelta
from datetime import datetime, time, timedelta, timezone

from elasticsearch_dsl.utils import AttrDict, AttrList

from django.utils.timezone import now, utc
from django.utils.timezone import now
from django.utils.module_loading import import_string
from django.core.serializers.json import DjangoJSONEncoder

Expand Down Expand Up @@ -441,8 +441,8 @@ def clean_logs(self, type, timestamp, backup_path, stdout, stderr):
step_timestamp = list(qs[0:1])[0].start

while step_timestamp and step_timestamp < timestamp:
min_timestamp = datetime.combine(step_timestamp, time.min).replace(tzinfo=utc)
max_timestamp = datetime.combine(step_timestamp, time.max).replace(tzinfo=utc)
min_timestamp = datetime.combine(step_timestamp, time.min).replace(tzinfo=timezone.utc)
max_timestamp = datetime.combine(step_timestamp, time.max).replace(tzinfo=timezone.utc)

qs_filtered_by_day = qs.filter(Q('range', start={'gte': min_timestamp, 'lte': max_timestamp})).sort(
'start', 'id'
Expand Down
10 changes: 5 additions & 5 deletions security/backends/sql/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

from io import TextIOWrapper

from datetime import datetime, time, timedelta
from datetime import datetime, time, timedelta, timezone

from django.core import serializers
from django.core.serializers.json import DjangoJSONEncoder
from django.db import router, transaction
from django.utils.timezone import now, utc
from django.utils.timezone import now
from django.utils.module_loading import import_string

from celery import current_app
Expand Down Expand Up @@ -290,9 +290,9 @@ def clean_logs(self, type, timestamp, backup_path, stdout, stderr):
storage = import_string(settings.BACKUP_STORAGE_CLASS)()

qs = get_log_model_from_logger_name(type).objects.filter(stop__lte=timestamp).order_by('stop')
for step_timestamp in qs.datetimes('start', 'day', tzinfo=utc):
min_timestamp = datetime.combine(step_timestamp, time.min).replace(tzinfo=utc)
max_timestamp = datetime.combine(step_timestamp, time.max).replace(tzinfo=utc)
for step_timestamp in qs.datetimes('start', 'day', tzinfo=timezone.utc):
min_timestamp = datetime.combine(step_timestamp, time.min).replace(tzinfo=timezone.utc)
max_timestamp = datetime.combine(step_timestamp, time.max).replace(tzinfo=timezone.utc)
qs_filtered_by_day = qs.filter(stop__range=(min_timestamp, max_timestamp))

for qs_batch in get_querysets_by_batch(qs_filtered_by_day, settings.CLEAN_LOGS_BACKUP_FILE_BATCH_SIZE):
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ def read(fname):
'Topic :: Internet :: WWW/HTTP :: Site Management',
],
install_requires=[
'django>=4.2',
'django>=5.2',
'django-ipware>=3.0.2',
'ansi2html>=1.6.0',
'skip-django-chamber>=0.7.2',
'skip-django-choice-enumfields>=1.1.3.2',
'skip-django-generic-m2m-field>=0.1.0',
'skip-django-celery-extensions>=0.1.0',
'skip-django-celery-extensions>=1.1.0',
'isodate>=0.6.1',
'structlog>=24.4.0',
'setuptools>=82.0.0',
],
zip_safe=False
)