Commit 04c716cf authored by Florent Chehab's avatar Florent Chehab
Browse files

Merge branch 'update_back_linting' into 'master'

Update back linting and fix documentation job failing on master

Closes #44

See merge request rex-dri/rex-dri!44
parents 3a3bbbd2 955238be
Pipeline #34792 passed with stages
in 2 minutes and 57 seconds
...@@ -14,19 +14,18 @@ from datetime import datetime ...@@ -14,19 +14,18 @@ from datetime import datetime
class LoadUniversityEx(LoadGeneric): class LoadUniversityEx(LoadGeneric):
def __init__(self, admin): def __init__(self, admin):
self.admin = admin self.admin = admin
def load(self): def load(self):
EPFL = University.objects.get(acronym='EPFL') EPFL = University.objects.get(acronym="EPFL")
CHF = Currency.objects.get(pk='CHF') CHF = Currency.objects.get(pk="CHF")
ACCOMMODATION_TAG = Tag.objects.get(name='accommodation') ACCOMMODATION_TAG = Tag.objects.get(name="accommodation")
SWITZERLAND = Country.objects.get(pk="CH") SWITZERLAND = Country.objects.get(pk="CH")
univ_dri_1 = UniversityDri( univ_dri_1 = UniversityDri(
title="Cours en anglais", title="Cours en anglais",
importance_level='+', importance_level="+",
comment="Les cours de master en computer science sont 100% en anglais", comment="Les cours de master en computer science sont 100% en anglais",
) )
univ_dri_1.save() univ_dri_1.save()
...@@ -38,13 +37,14 @@ class LoadUniversityEx(LoadGeneric): ...@@ -38,13 +37,14 @@ class LoadUniversityEx(LoadGeneric):
univ_info.costs_currency = CHF univ_info.costs_currency = CHF
self.add_info_and_save(univ_info, self.admin) self.add_info_and_save(univ_info, self.admin)
usd = UniversitySemestersDates.objects.get( usd = UniversitySemestersDates.objects.get(university=EPFL)
university=EPFL) usd.autumn_begin = datetime.strptime("17/09/2018", "%d/%m/%Y")
usd.autumn_begin = datetime.strptime("17/09/2018", '%d/%m/%Y') usd.autumn_end = datetime.strptime("29/01/2019", "%d/%m/%Y")
usd.autumn_end = datetime.strptime("29/01/2019", '%d/%m/%Y')
usd.useful_links = [ usd.useful_links = [
{"url": "https://memento.epfl.ch/academic-calendar", {
"description": "Site de l'EPFL"} "url": "https://memento.epfl.ch/academic-calendar",
"description": "Site de l'EPFL",
}
] ]
self.add_info_and_save(usd, self.admin) self.add_info_and_save(usd, self.admin)
...@@ -52,10 +52,10 @@ class LoadUniversityEx(LoadGeneric): ...@@ -52,10 +52,10 @@ class LoadUniversityEx(LoadGeneric):
title="Swiss European Mobility Programme", title="Swiss European Mobility Programme",
type="Bourse du gouvernement suisse", type="Bourse du gouvernement suisse",
currency=CHF, currency=CHF,
frequency='s', frequency="s",
amount_min=2200, amount_min=2200,
amount_max=2200, amount_max=2200,
comment="Bourse attribuée de manière automatique." comment="Bourse attribuée de manière automatique.",
) )
country_scholarship.save() country_scholarship.save()
country_scholarship.countries.add(SWITZERLAND) country_scholarship.countries.add(SWITZERLAND)
...@@ -66,6 +66,6 @@ class LoadUniversityEx(LoadGeneric): ...@@ -66,6 +66,6 @@ class LoadUniversityEx(LoadGeneric):
tag=ACCOMMODATION_TAG, tag=ACCOMMODATION_TAG,
title="C'est compliqué de trouver un logement", title="C'est compliqué de trouver un logement",
comment="Mon commentaire.", comment="Mon commentaire.",
importance_level='++' importance_level="++",
) )
self.add_info_and_save(univ_tag_1, self.admin) self.add_info_and_save(univ_tag_1, self.admin)
...@@ -6,204 +6,208 @@ from django.db import migrations, models ...@@ -6,204 +6,208 @@ from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [("backend_app", "0001_initial")]
('backend_app', '0001_initial'),
]
operations = [ operations = [
migrations.AlterField( migrations.AlterField(
model_name='campus', model_name="campus",
name='comment', name="comment",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='campus', model_name="campus",
name='name', name="name",
field=models.CharField(blank=True, default='', max_length=200), field=models.CharField(blank=True, default="", max_length=200),
), ),
migrations.AlterField( migrations.AlterField(
model_name='campus', model_name="campus",
name='title', name="title",
field=models.CharField(blank=True, default='', max_length=150), field=models.CharField(blank=True, default="", max_length=150),
), ),
migrations.AlterField( migrations.AlterField(
model_name='campustaggeditem', model_name="campustaggeditem",
name='comment', name="comment",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='campustaggeditem', model_name="campustaggeditem",
name='title', name="title",
field=models.CharField(blank=True, default='', max_length=150), field=models.CharField(blank=True, default="", max_length=150),
), ),
migrations.AlterField( migrations.AlterField(
model_name='city', model_name="city",
name='area', name="area",
field=models.CharField(blank=True, default='', max_length=200), field=models.CharField(blank=True, default="", max_length=200),
), ),
migrations.AlterField( migrations.AlterField(
model_name='city', model_name="city",
name='local_name', name="local_name",
field=models.CharField(blank=True, default='', max_length=200), field=models.CharField(blank=True, default="", max_length=200),
), ),
migrations.AlterField( migrations.AlterField(
model_name='citytaggeditem', model_name="citytaggeditem",
name='comment', name="comment",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='citytaggeditem', model_name="citytaggeditem",
name='title', name="title",
field=models.CharField(blank=True, default='', max_length=150), field=models.CharField(blank=True, default="", max_length=150),
), ),
migrations.AlterField( migrations.AlterField(
model_name='country', model_name="country",
name='intermediate_region_name', name="intermediate_region_name",
field=models.CharField(blank=True, default='', max_length=200), field=models.CharField(blank=True, default="", max_length=200),
), ),
migrations.AlterField( migrations.AlterField(
model_name='country', model_name="country",
name='intermediate_region_un_code', name="intermediate_region_un_code",
field=models.CharField(blank=True, default='', max_length=3), field=models.CharField(blank=True, default="", max_length=3),
), ),
migrations.AlterField( migrations.AlterField(
model_name='country', model_name="country",
name='iso_alpha3_code', name="iso_alpha3_code",
field=models.CharField(blank=True, default='', max_length=3, unique=True), field=models.CharField(blank=True, default="", max_length=3, unique=True),
), ),
migrations.AlterField( migrations.AlterField(
model_name='country', model_name="country",
name='sub_region_name', name="sub_region_name",
field=models.CharField(blank=True, default='', max_length=200), field=models.CharField(blank=True, default="", max_length=200),
), ),
migrations.AlterField( migrations.AlterField(
model_name='country', model_name="country",
name='sub_region_un_code', name="sub_region_un_code",
field=models.CharField(blank=True, default='', max_length=3), field=models.CharField(blank=True, default="", max_length=3),
), ),
migrations.AlterField( migrations.AlterField(
model_name='countrydri', model_name="countrydri",
name='comment', name="comment",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='countrydri', model_name="countrydri",
name='title', name="title",
field=models.CharField(blank=True, default='', max_length=150), field=models.CharField(blank=True, default="", max_length=150),
), ),
migrations.AlterField( migrations.AlterField(
model_name='countryscholarship', model_name="countryscholarship",
name='comment', name="comment",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='countryscholarship', model_name="countryscholarship",
name='other_advantages', name="other_advantages",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='countryscholarship', model_name="countryscholarship",
name='title', name="title",
field=models.CharField(blank=True, default='', max_length=150), field=models.CharField(blank=True, default="", max_length=150),
), ),
migrations.AlterField( migrations.AlterField(
model_name='countrytaggeditem', model_name="countrytaggeditem",
name='comment', name="comment",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='countrytaggeditem', model_name="countrytaggeditem",
name='title', name="title",
field=models.CharField(blank=True, default='', max_length=150), field=models.CharField(blank=True, default="", max_length=150),
), ),
migrations.AlterField( migrations.AlterField(
model_name='currency', model_name="currency",
name='symbol', name="symbol",
field=models.CharField(blank=True, default='', max_length=30), field=models.CharField(blank=True, default="", max_length=30),
), ),
migrations.AlterField( migrations.AlterField(
model_name='previousdeparturefeedback', model_name="previousdeparturefeedback",
name='adequation_comment', name="adequation_comment",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='previousdeparturefeedback', model_name="previousdeparturefeedback",
name='integration_comment', name="integration_comment",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='recommendation', model_name="recommendation",
name='comment', name="comment",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='university', model_name="university",
name='acronym', name="acronym",
field=models.CharField(blank=True, default='', max_length=20), field=models.CharField(blank=True, default="", max_length=20),
), ),
migrations.AlterField( migrations.AlterField(
model_name='university', model_name="university",
name='logo', name="logo",
field=models.URLField(blank=True, default='', validators=[backend_app.models.university.university.validate_extension_django]), field=models.URLField(
blank=True,
default="",
validators=[
backend_app.models.university.university.validate_extension_django
],
),
), ),
migrations.AlterField( migrations.AlterField(
model_name='university', model_name="university",
name='website', name="website",
field=models.URLField(blank=True, default='', max_length=300), field=models.URLField(blank=True, default="", max_length=300),
), ),
migrations.AlterField( migrations.AlterField(
model_name='universitydri', model_name="universitydri",
name='comment', name="comment",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='universitydri', model_name="universitydri",
name='title', name="title",
field=models.CharField(blank=True, default='', max_length=150), field=models.CharField(blank=True, default="", max_length=150),
), ),
migrations.AlterField( migrations.AlterField(
model_name='universityinfo', model_name="universityinfo",
name='comment', name="comment",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='universityinfo', model_name="universityinfo",
name='title', name="title",
field=models.CharField(blank=True, default='', max_length=150), field=models.CharField(blank=True, default="", max_length=150),
), ),
migrations.AlterField( migrations.AlterField(
model_name='universityscholarship', model_name="universityscholarship",
name='comment', name="comment",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='universityscholarship', model_name="universityscholarship",
name='other_advantages', name="other_advantages",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='universityscholarship', model_name="universityscholarship",
name='title', name="title",
field=models.CharField(blank=True, default='', max_length=150), field=models.CharField(blank=True, default="", max_length=150),
), ),
migrations.AlterField( migrations.AlterField(
model_name='universitysemestersdates', model_name="universitysemestersdates",
name='comment', name="comment",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='universitysemestersdates', model_name="universitysemestersdates",
name='title', name="title",
field=models.CharField(blank=True, default='', max_length=150), field=models.CharField(blank=True, default="", max_length=150),
), ),
migrations.AlterField( migrations.AlterField(
model_name='universitytaggeditem', model_name="universitytaggeditem",
name='comment', name="comment",
field=models.CharField(blank=True, default='', max_length=5000), field=models.CharField(blank=True, default="", max_length=5000),
), ),
migrations.AlterField( migrations.AlterField(
model_name='universitytaggeditem', model_name="universitytaggeditem",
name='title', name="title",
field=models.CharField(blank=True, default='', max_length=150), field=models.CharField(blank=True, default="", max_length=150),
), ),
] ]
...@@ -5,19 +5,41 @@ from django.db import migrations, models ...@@ -5,19 +5,41 @@ from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [("backend_app", "0002_auto_20180916_1555")]
('backend_app', '0002_auto_20180916_1555'),
]
operations = [ operations = [
migrations.AlterField( migrations.AlterField(
model_name='countryscholarship', model_name="countryscholarship",
name='frequency', name="frequency",
field=models.CharField(blank=True, choices=[('w', 'week'), ('m', 'month'), ('s', 'semester'), ('y', 'year'), ('o', 'one_shot')], default='m', max_length=1, null=True), field=models.CharField(
blank=True,
choices=[
("w", "week"),
("m", "month"),
("s", "semester"),
("y", "year"),
("o", "one_shot"),
],
default="m",
max_length=1,
null=True,
),
), ),
migrations.AlterField( migrations.AlterField(
model_name='universityscholarship', model_name="universityscholarship",
name='frequency', name="frequency",
field=models.CharField(blank=True, choices=[('w', 'week'), ('m', 'month'), ('s', 'semester'), ('y', 'year'), ('o', 'one_shot')], default='m', max_length=1, null=True), field=models.CharField(
blank=True,
choices=[
("w", "week"),
("m", "month"),
("s", "semester"),
("y", "year"),
("o", "one_shot"),
],
default="m",
max_length=1,
null=True,
),
), ),
] ]
from .basicModule import BasicModule, BasicModuleSerializer, BasicModuleViewSet # noqa: F401 from .basicModule import BasicModule, BasicModuleSerializer, BasicModuleViewSet
__all__ = ["BasicModule", "BasicModuleSerializer", "BasicModuleViewSet"]
from django.db import models from django.db import models
from backend_app.models.abstract.my_model import MyModelVersionned, MyModelVersionnedSerializer, MyModelVersionnedViewSet from backend_app.models.abstract.my_model import (
MyModelVersionned,
MyModelVersionnedSerializer,
MyModelVersionnedViewSet,
)
from backend_app.fields import JSONField from backend_app.fields import JSONField
from backend_app.validators.tag import validate_content_against_config from backend_app.validators.tag import validate_content_against_config
from backend_app.validators.tag.tags_config import USEFULL_LINKS_CONFIG from backend_app.validators.tag.tags_config import USEFULL_LINKS_CONFIG
IMPORTANCE_LEVEL = ( IMPORTANCE_LEVEL = (("-", "normal"), ("+", "important"), ("++", "IMPORTANT"))
('-', 'normal'),
('+', 'important'),
('++', 'IMPORTANT')
)