mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-02-25 18:26:30 +00:00
Compare commits
15 Commits
a853be73c5
...
cf561c4584
Author | SHA1 | Date | |
---|---|---|---|
|
cf561c4584 | ||
|
e2679cf5e8 | ||
|
122edeef48 | ||
|
4ff9f44eae | ||
|
5d13d9bc16 | ||
|
121e1da37d | ||
|
8222f3b781 | ||
|
dc56396012 | ||
|
f1d2acdc25 | ||
|
50e95ad3f2 | ||
|
7848a90d5d | ||
|
f08cb229ca | ||
|
b0fbb406f6 | ||
|
0f2f34175c | ||
|
6226f06d97 |
@ -2,22 +2,24 @@ stages:
|
||||
- test
|
||||
- quality-assurance
|
||||
|
||||
py310:
|
||||
stage: test
|
||||
image: python:3.10-alpine
|
||||
before_script:
|
||||
- apk add --no-cache libmagic
|
||||
- pip install tox --no-cache-dir
|
||||
script: tox -e py310
|
||||
|
||||
py311:
|
||||
stage: test
|
||||
image: python:3.11-alpine
|
||||
before_script:
|
||||
- apk add --no-cache libmagic
|
||||
- apk add --no-cache git # Useful for django-haystack, remove when the newer versions are in PyPI
|
||||
- pip install tox --no-cache-dir
|
||||
script: tox -e py311
|
||||
|
||||
py312:
|
||||
stage: test
|
||||
image: python:3.12-alpine
|
||||
before_script:
|
||||
- apk add --no-cache libmagic
|
||||
- apk add --no-cache git # Useful for django-haystack, remove when the newer versions are in PyPI
|
||||
- pip install tox --no-cache-dir
|
||||
script: tox -e py312
|
||||
|
||||
linters:
|
||||
stage: quality-assurance
|
||||
image: python:3-alpine
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM python:3.11-alpine
|
||||
FROM python:3.12-alpine
|
||||
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
ENV DJANGO_ALLOW_ASYNC_UNSAFE 1
|
||||
@ -13,8 +13,6 @@ COPY requirements.txt /code/requirements.txt
|
||||
COPY docs/requirements.txt /code/docs/requirements.txt
|
||||
RUN pip install -r requirements.txt --no-cache-dir
|
||||
RUN pip install -r docs/requirements.txt --no-cache-dir
|
||||
# FIXME Remove this line when all dependencies will be ready
|
||||
RUN pip install "Django>=4.2,<5.0"
|
||||
|
||||
COPY . /code/
|
||||
|
||||
|
31
draw/migrations/0002_alter_teamdraw_purposed.py
Normal file
31
draw/migrations/0002_alter_teamdraw_purposed.py
Normal file
@ -0,0 +1,31 @@
|
||||
# Generated by Django 5.0.1 on 2024-01-13 16:21
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("draw", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="teamdraw",
|
||||
name="purposed",
|
||||
field=models.PositiveSmallIntegerField(
|
||||
choices=[
|
||||
(1, "Problem #1"),
|
||||
(2, "Problem #2"),
|
||||
(3, "Problem #3"),
|
||||
(4, "Problem #4"),
|
||||
(5, "Problem #5"),
|
||||
(6, "Problem #6"),
|
||||
(7, "Problem #7"),
|
||||
(8, "Problem #8"),
|
||||
],
|
||||
default=None,
|
||||
null=True,
|
||||
verbose_name="purposed problem",
|
||||
),
|
||||
),
|
||||
]
|
@ -4,6 +4,7 @@ crond -l 0
|
||||
|
||||
python manage.py migrate
|
||||
python manage.py loaddata initial
|
||||
python manage.py update_index
|
||||
|
||||
nginx
|
||||
|
||||
|
@ -17,6 +17,7 @@ from django.utils.translation import gettext_lazy as _
|
||||
from registration.models import VolunteerRegistration
|
||||
from tfjm.lists import get_sympa_client
|
||||
|
||||
|
||||
def get_motivation_letter_filename(instance, filename):
|
||||
return f"authorization/motivation_letters/motivation_letter_{instance.trigram}"
|
||||
|
||||
|
@ -7,7 +7,6 @@ from django.contrib.auth.models import User
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.sites.models import Site
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from django.core.management import call_command
|
||||
from django.test import TestCase
|
||||
from django.urls import reverse
|
||||
from django.utils.encoding import force_bytes
|
||||
@ -413,18 +412,18 @@ class TestRegistration(TestCase):
|
||||
"""
|
||||
Try to search some things.
|
||||
"""
|
||||
call_command("rebuild_index", "--noinput", "-v", 0)
|
||||
|
||||
response = self.client.get(reverse("haystack_search") + "?q=" + self.user.email)
|
||||
response = self.client.get(reverse("haystack_search") + "?q=" + self.user.email + "&models=auth.user")
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertTrue(response.context["object_list"])
|
||||
|
||||
response = self.client.get(reverse("haystack_search") + "?q=" +
|
||||
str(self.coach.registration.professional_activity))
|
||||
str(self.coach.registration.professional_activity)
|
||||
+ "&models=registration.CoachRegistration")
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertTrue(response.context["object_list"])
|
||||
|
||||
response = self.client.get(reverse("haystack_search") + "?q=" +
|
||||
self.student.registration.get_student_class_display())
|
||||
self.student.registration.school + "&models=registration.StudentRegistration")
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertTrue(response.context["object_list"])
|
||||
|
@ -1,26 +1,26 @@
|
||||
channels[daphne]~=4.0.0
|
||||
channels-redis~=4.0.0
|
||||
crispy-bootstrap5~=0.7
|
||||
Django>=4.1,<5.0
|
||||
django-crispy-forms~=1.14
|
||||
django-extensions~=3.2
|
||||
django-filter~=22.1
|
||||
django-haystack~=3.2
|
||||
django-mailer~=2.2
|
||||
django-phonenumber-field~=7.0
|
||||
django-polymorphic~=3.1
|
||||
django-tables2~=2.4
|
||||
djangorestframework~=3.14
|
||||
django-rest-polymorphic~=0.1
|
||||
gunicorn~=20.1
|
||||
channels-redis~=4.2.0
|
||||
crispy-bootstrap5~=2023.10
|
||||
Django>=5.0,<6.0
|
||||
django-crispy-forms~=2.1
|
||||
django-extensions~=3.2.3
|
||||
django-filter~=23.5
|
||||
elasticsearch~=7.17.9
|
||||
git+https://github.com/django-haystack/django-haystack.git#v3.3b1
|
||||
django-mailer~=2.3.1
|
||||
django-phonenumber-field~=7.3.0
|
||||
django-polymorphic~=3.1.0
|
||||
django-tables2~=2.7.0
|
||||
djangorestframework~=3.14.0
|
||||
django-rest-polymorphic~=0.1.10
|
||||
gunicorn~=21.2.0
|
||||
odfpy~=1.4.1
|
||||
phonenumbers~=8.12.57
|
||||
psycopg2-binary~=2.9.5
|
||||
pypdf~=3.4
|
||||
ipython~=8.11.0
|
||||
python-magic~=0.4.26
|
||||
requests~=2.28.1
|
||||
phonenumbers~=8.13.27
|
||||
psycopg2-binary~=2.9.9
|
||||
pypdf~=3.17.4
|
||||
ipython~=8.20.0
|
||||
python-magic~=0.4.27
|
||||
requests~=2.31.0
|
||||
sympasoap~=1.1
|
||||
uvicorn~=0.17
|
||||
websockets~=10.4
|
||||
whoosh~=2.7
|
||||
uvicorn~=0.25.0
|
||||
websockets~=12.0
|
@ -4,9 +4,6 @@
|
||||
* * * * * cd /code && python manage.py retry_deferred -c 1
|
||||
0 0 * * * cd /code && python manage.py purge_mail_log 7 -c 1
|
||||
|
||||
# Rebuild search index
|
||||
0 * * * * cd /code && python manage.py update_index -v 0
|
||||
|
||||
# Recreate sympa lists
|
||||
*/2 * * * * cd /code && python manage.py fix_sympa_lists &> /dev/null
|
||||
|
||||
|
@ -203,13 +203,10 @@ DJANGO_TABLES2_TEMPLATE = 'django_tables2/bootstrap5.html'
|
||||
|
||||
HAYSTACK_CONNECTIONS = {
|
||||
'default': {
|
||||
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
|
||||
'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'),
|
||||
'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
|
||||
}
|
||||
}
|
||||
|
||||
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
|
||||
|
||||
_db_type = os.getenv('DJANGO_DB_TYPE', 'sqlite').lower()
|
||||
|
||||
if _db_type == 'mysql' or _db_type.startswith('postgres') or _db_type == 'psql': # pragma: no cover
|
||||
|
@ -39,3 +39,13 @@ CHANNEL_LAYERS = {
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
HAYSTACK_CONNECTIONS = {
|
||||
'default': {
|
||||
'ENGINE': 'haystack.backends.elasticsearch7_backend.Elasticsearch7SearchEngine',
|
||||
'URL': 'http://elasticsearch:9200/',
|
||||
'INDEX_NAME': os.getenv('HAYSTACK_INDEX_NAME', 'inscription-tfjm'),
|
||||
}
|
||||
}
|
||||
|
||||
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
|
||||
|
32
tox.ini
32
tox.ini
@ -1,7 +1,7 @@
|
||||
[tox]
|
||||
envlist =
|
||||
py310
|
||||
py311
|
||||
py312
|
||||
|
||||
linters
|
||||
skipsdist = True
|
||||
@ -11,22 +11,22 @@ sitepackages = False
|
||||
deps =
|
||||
coverage
|
||||
channels[daphne]~=4.0.0
|
||||
crispy-bootstrap5~=0.7
|
||||
Django>=4.2,<5.0
|
||||
django-crispy-forms~=1.14
|
||||
django-filter~=22.1
|
||||
django-haystack~=3.2
|
||||
django-phonenumber-field~=7.0
|
||||
django-polymorphic~=3.1
|
||||
django-tables2~=2.4
|
||||
djangorestframework~=3.14
|
||||
django-rest-polymorphic~=0.1
|
||||
crispy-bootstrap5~=2023.10
|
||||
Django>=5.0,<6.0
|
||||
django-crispy-forms~=2.1
|
||||
django-filter~=23.5
|
||||
git+https://github.com/django-haystack/django-haystack.git#v3.3b1
|
||||
django-phonenumber-field~=7.3.0
|
||||
django-polymorphic~=3.1.0
|
||||
django-tables2~=2.7.0
|
||||
djangorestframework~=3.14.0
|
||||
django-rest-polymorphic~=0.1.10
|
||||
odfpy~=1.4.1
|
||||
phonenumbers~=8.12.57
|
||||
pypdf~=3.4
|
||||
python-magic~=0.4.26
|
||||
requests~=2.28.1
|
||||
whoosh~=2.7
|
||||
phonenumbers~=8.13.27
|
||||
pypdf~=3.17.4
|
||||
python-magic~=0.4.27
|
||||
requests~=2.31.0
|
||||
|
||||
commands =
|
||||
coverage run --source=api,draw,logs,participation,registration,tfjm ./manage.py test api/ draw/ logs/ participation/ registration/ tfjm/
|
||||
coverage report -m
|
||||
|
Loading…
x
Reference in New Issue
Block a user