mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-28 23:43:22 +00:00
refactor: Traduction en anglais des modules "GestionInscription" et
"GestionLogin"
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import logging
|
||||
from django.db.models import Q
|
||||
from GestionInscriptions.models import FicheInscription, Profil, Eleve
|
||||
from Subscriptions.models import RegistrationForm, Profile, Student
|
||||
|
||||
logger = logging.getLogger('N3wtSchool')
|
||||
|
||||
@ -43,12 +43,12 @@ def getProfile(objectList, valueToCheck):
|
||||
return result
|
||||
|
||||
def getEleveByCodeFI(_codeFI):
|
||||
eleve = None
|
||||
ficheInscriptions_List=getAllObjects(FicheInscription)
|
||||
for fi in ficheInscriptions_List:
|
||||
if fi.codeLienInscription == _codeFI:
|
||||
eleve = fi.eleve
|
||||
return eleve
|
||||
student = None
|
||||
ficheInscriptions_List=getAllObjects(RegistrationForm)
|
||||
for rf in ficheInscriptions_List:
|
||||
if rf.codeLienInscription == _codeFI:
|
||||
student = rf.student
|
||||
return student
|
||||
|
||||
def getLastId(_object):
|
||||
result = 1
|
||||
@ -61,7 +61,7 @@ def getLastId(_object):
|
||||
def searchObjects(_objectName, _searchTerm=None, _excludeStates=None):
|
||||
"""
|
||||
Recherche générique sur les objets avec possibilité d'exclure certains états
|
||||
_objectName: Classe du modèle
|
||||
_objectName: SchoolClass du modèle
|
||||
_searchTerm: Terme de recherche
|
||||
_excludeStates: Liste d'état à exclure de la recherche (optionnel)
|
||||
"""
|
||||
@ -70,18 +70,18 @@ def searchObjects(_objectName, _searchTerm=None, _excludeStates=None):
|
||||
|
||||
# Si on a un état à exclure
|
||||
if _excludeStates is not None:
|
||||
query = query.exclude(etat__in=_excludeStates)
|
||||
query = query.exclude(status__in=_excludeStates)
|
||||
|
||||
# Si on a un terme de recherche
|
||||
if _searchTerm and _searchTerm.strip():
|
||||
terms = _searchTerm.lower().strip().split()
|
||||
for term in terms:
|
||||
query = query.filter(
|
||||
Q(eleve__nom__icontains=term) |
|
||||
Q(eleve__prenom__icontains=term)
|
||||
Q(student__last_name__icontains=term) |
|
||||
Q(student__first_name__icontains=term)
|
||||
)
|
||||
|
||||
return query.order_by('eleve__nom', 'eleve__prenom')
|
||||
return query.order_by('student__last_name', 'student__first_name')
|
||||
|
||||
except _objectName.DoesNotExist:
|
||||
logging.error(f"Aucun résultat n'a été trouvé - {_objectName.__name__} (recherche: {_searchTerm})")
|
||||
|
||||
@ -19,7 +19,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
MEDIA_URL = '/data/'
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'data')
|
||||
|
||||
LOGIN_REDIRECT_URL = '/GestionInscriptions/fichesInscriptions'
|
||||
LOGIN_REDIRECT_URL = '/Subscriptions/registerForms'
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
|
||||
@ -35,11 +35,11 @@ ALLOWED_HOSTS = ['*']
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'GestionInscriptions.apps.GestioninscriptionsConfig',
|
||||
'GestionLogin.apps.GestionloginConfig',
|
||||
'Subscriptions.apps.GestioninscriptionsConfig',
|
||||
'Auth.apps.GestionloginConfig',
|
||||
'GestionMessagerie.apps.GestionMessagerieConfig',
|
||||
'GestionNotification.apps.GestionNotificationConfig',
|
||||
'GestionEnseignants.apps.GestionenseignantsConfig',
|
||||
'School.apps.SchoolConfig',
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
@ -133,12 +133,12 @@ LOGGING = {
|
||||
"level": os.getenv("GESTION_NOTIFICATION_LOG_LEVEL", "INFO"),
|
||||
"propagate": False,
|
||||
},
|
||||
"GestionLogin": {
|
||||
"Auth": {
|
||||
"handlers": ["console"],
|
||||
"level": os.getenv("GESTION_LOGIN_LOG_LEVEL", "INFO"),
|
||||
"propagate": False,
|
||||
},
|
||||
"GestionInscriptions": {
|
||||
"Subscriptions": {
|
||||
"handlers": ["console"],
|
||||
"level": os.getenv("GESTION_INSCRIPTIONS_LOG_LEVEL", "DEBUG"),
|
||||
"propagate": False,
|
||||
@ -148,7 +148,7 @@ LOGGING = {
|
||||
"level": os.getenv("GESTION_MESSAGERIE_LOG_LEVEL", "INFO"),
|
||||
"propagate": False,
|
||||
},
|
||||
"GestionEnseignants": {
|
||||
"School": {
|
||||
"handlers": ["console"],
|
||||
"level": os.getenv("GESTION_ENSEIGNANTS_LOG_LEVEL", "INFO"),
|
||||
"propagate": False,
|
||||
@ -211,7 +211,7 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
#################### Application Settings ##############################
|
||||
########################################################################
|
||||
|
||||
with open('GestionInscriptions/Configuration/application.json', 'r') as f:
|
||||
with open('Subscriptions/Configuration/application.json', 'r') as f:
|
||||
jsonObject = json.load(f)
|
||||
|
||||
DJANGO_SUPERUSER_PASSWORD='admin'
|
||||
@ -275,8 +275,8 @@ DATABASES = {
|
||||
}
|
||||
}
|
||||
|
||||
AUTH_USER_MODEL = 'GestionLogin.Profil'
|
||||
AUTHENTICATION_BACKENDS = ('GestionLogin.backends.EmailBackend', )
|
||||
AUTH_USER_MODEL = 'Auth.Profile'
|
||||
AUTHENTICATION_BACKENDS = ('Auth.backends.EmailBackend', )
|
||||
SILENCED_SYSTEM_CHECKS = ["auth.W004"]
|
||||
|
||||
EXPIRATION_URL_NB_DAYS = 7
|
||||
@ -289,7 +289,7 @@ NB_RESULT_PER_PAGE = 8
|
||||
NB_MAX_PAGE = 100
|
||||
|
||||
REST_FRAMEWORK = {
|
||||
'DEFAULT_PAGINATION_CLASS': 'GestionInscriptions.pagination.CustomPagination',
|
||||
'DEFAULT_PAGINATION_CLASS': 'Subscriptions.pagination.CustomPagination',
|
||||
'PAGE_SIZE': NB_RESULT_PER_PAGE
|
||||
}
|
||||
|
||||
|
||||
@ -16,6 +16,6 @@ def setup_periodic_tasks(sender, **kwargs):
|
||||
PeriodicTask.objects.get_or_create(
|
||||
interval=schedule, # Utiliser l'intervalle défini ci-dessus
|
||||
name='Tâche périodique toutes les 5 secondes',
|
||||
task='GestionInscriptions.tasks.check_for_signature_deadlines', # Remplacer par le nom de ta tâche
|
||||
task='Subscriptions.tasks.check_for_signature_deadlines', # Remplacer par le nom de ta tâche
|
||||
kwargs=json.dumps({}) # Si nécessaire, ajoute
|
||||
)
|
||||
@ -7,7 +7,7 @@ Examples:
|
||||
Function views
|
||||
1. Add an import: from my_app import views
|
||||
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
||||
Class-based views
|
||||
SchoolClass-based views
|
||||
1. Add an import: from other_app.views import Home
|
||||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
||||
Including another URLconf
|
||||
@ -39,11 +39,11 @@ schema_view = get_schema_view(
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path("GestionInscriptions/", include(("GestionInscriptions.urls", 'GestionInscriptions'), namespace='GestionInscriptions')),
|
||||
path("GestionLogin/", include(("GestionLogin.urls", 'GestionLogin'), namespace='GestionLogin')),
|
||||
path("Subscriptions/", include(("Subscriptions.urls", 'Subscriptions'), namespace='Subscriptions')),
|
||||
path("Auth/", include(("Auth.urls", 'Auth'), namespace='Auth')),
|
||||
path("GestionMessagerie/", include(("GestionMessagerie.urls", 'GestionMessagerie'), namespace='GestionMessagerie')),
|
||||
path("GestionNotification/", include(("GestionNotification.urls", 'GestionNotification'), namespace='GestionNotification')),
|
||||
path("GestionEnseignants/", include(("GestionEnseignants.urls", 'GestionEnseignants'), namespace='GestionEnseignants')),
|
||||
path("School/", include(("School.urls", 'School'), namespace='School')),
|
||||
# Documentation Api
|
||||
re_path(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
|
||||
path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
|
||||
|
||||
Reference in New Issue
Block a user