Skip to content
Snippets Groups Projects
Verified Commit b839e6aa authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Reformat

parent 6587ab6a
No related branches found
No related tags found
No related merge requests found
Pipeline #3775 failed
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from ...tasks import untis_import_mysql_current_term, untis_import_mysql_all_terms from ...tasks import untis_import_mysql_all_terms, untis_import_mysql_current_term
class Command(BaseCommand): class Command(BaseCommand):
......
# Generated by Django 3.0.9 on 2020-08-20 13:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('untis', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='globalpermissions',
options={'managed': False, 'permissions': (('do_xml_import', 'Kann XML-Import durchführen'), ('assign_subjects_to_groups', 'Kann Fächer zu Gruppen zuzuordnen'))},
),
]
from aleksis.apps.untis.util.mysql.importers.terms import ( from aleksis.apps.untis.util.mysql.importers.terms import (
get_terms_for_date,
get_future_terms_for_date, get_future_terms_for_date,
get_terms_for_date,
) )
from aleksis.core.util.core_helpers import celery_optional from aleksis.core.util.core_helpers import celery_optional
from .util.mysql.main import untis_import_mysql as _untis_import_mysql from .util.mysql.main import untis_import_mysql as _untis_import_mysql
...@@ -37,6 +36,7 @@ def untis_import_mysql_current_next_term(): ...@@ -37,6 +36,7 @@ def untis_import_mysql_current_next_term():
terms = terms.union(future_terms[0:1]) terms = terms.union(future_terms[0:1])
_untis_import_mysql(terms) _untis_import_mysql(terms)
@celery_optional @celery_optional
def untis_import_mysql_current_future_terms(): def untis_import_mysql_current_future_terms():
"""Celery task for import of UNTIS data from MySQL (current and future terms).""" """Celery task for import of UNTIS data from MySQL (current and future terms)."""
......
...@@ -31,6 +31,7 @@ def get_terms_for_date(for_date: Optional[date] = None) -> QuerySet: ...@@ -31,6 +31,7 @@ def get_terms_for_date(for_date: Optional[date] = None) -> QuerySet:
return qs return qs
def get_future_terms_for_date(for_date: Optional[date] = None) -> QuerySet: def get_future_terms_for_date(for_date: Optional[date] = None) -> QuerySet:
"""Get all furture terms (after the current term).""" """Get all furture terms (after the current term)."""
...@@ -44,8 +45,6 @@ def get_future_terms_for_date(for_date: Optional[date] = None) -> QuerySet: ...@@ -44,8 +45,6 @@ def get_future_terms_for_date(for_date: Optional[date] = None) -> QuerySet:
return qs return qs
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -88,7 +87,9 @@ def import_terms( ...@@ -88,7 +87,9 @@ def import_terms(
schoolyear_id=school_year_id schoolyear_id=school_year_id
) )
school_term_name = ( school_term_name = (
school_year.text if school_year.text else school_year.schoolyearzoned school_year.text
if school_year.text
else school_year.schoolyearzoned
) )
logger.info(f" Import school year {school_year_id} ...") logger.info(f" Import school year {school_year_id} ...")
......
...@@ -5,10 +5,7 @@ from django.db.models import QuerySet ...@@ -5,10 +5,7 @@ from django.db.models import QuerySet
from tqdm import tqdm from tqdm import tqdm
from aleksis.apps.untis.util.mysql.importers.terms import ( from aleksis.apps.untis.util.mysql.importers.terms import import_terms
get_terms_for_date,
import_terms,
)
from aleksis.apps.untis.util.mysql.util import TQDM_DEFAULTS from aleksis.apps.untis.util.mysql.util import TQDM_DEFAULTS
from .importers.absences import import_absences from .importers.absences import import_absences
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment