From 3be9578ec3b96511188dec99a1ada0145216f54a Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 13 May 2024 23:10:22 +0200 Subject: [PATCH 01/49] Novinky split It's everything, everything at once. --- deploy_v2/admin_org_prava.json | 8 ++-- mamweb/settings_common.py | 1 + novinky/__init__.py | 0 novinky/admin.py | 3 ++ novinky/apps.py | 5 +++ novinky/migrations/0001_initial.py | 45 +++++++++++++++++++ novinky/migrations/0002_manage_novinky.py | 18 ++++++++ novinky/migrations/0003_novinky_post.py | 13 ++++++ novinky/migrations/__init__.py | 0 .../models/novinky.py => novinky/models.py | 1 + novinky/tests.py | 3 ++ novinky/views.py | 3 ++ personalni/migrations/0007_novinky_pre.py | 13 ++++++ personalni/migrations/0008_novinky_post.py | 14 ++++++ seminar/migrations/0126_novinky_pre.py | 14 ++++++ seminar/migrations/0127_unmanage_novinky.py | 17 +++++++ seminar/migrations/0128_delete_novinky.py | 17 +++++++ seminar/migrations/0129_novinky_post.py | 14 ++++++ seminar/models/__init__.py | 2 +- 19 files changed, 186 insertions(+), 5 deletions(-) create mode 100644 novinky/__init__.py create mode 100644 novinky/admin.py create mode 100644 novinky/apps.py create mode 100644 novinky/migrations/0001_initial.py create mode 100644 novinky/migrations/0002_manage_novinky.py create mode 100644 novinky/migrations/0003_novinky_post.py create mode 100644 novinky/migrations/__init__.py rename seminar/models/novinky.py => novinky/models.py (97%) create mode 100644 novinky/tests.py create mode 100644 novinky/views.py create mode 100644 personalni/migrations/0007_novinky_pre.py create mode 100644 personalni/migrations/0008_novinky_post.py create mode 100644 seminar/migrations/0126_novinky_pre.py create mode 100644 seminar/migrations/0127_unmanage_novinky.py create mode 100644 seminar/migrations/0128_delete_novinky.py create mode 100644 seminar/migrations/0129_novinky_post.py diff --git a/deploy_v2/admin_org_prava.json b/deploy_v2/admin_org_prava.json index 9caa6eb2..370aec4f 100644 --- a/deploy_v2/admin_org_prava.json +++ b/deploy_v2/admin_org_prava.json @@ -331,22 +331,22 @@ }, { "codename": "add_novinky", - "ct_app_label": "seminar", + "ct_app_label": "novinky", "ct_model": "novinky" }, { "codename": "change_novinky", - "ct_app_label": "seminar", + "ct_app_label": "novinky", "ct_model": "novinky" }, { "codename": "delete_novinky", - "ct_app_label": "seminar", + "ct_app_label": "novinky", "ct_model": "novinky" }, { "codename": "view_novinky", - "ct_app_label": "seminar", + "ct_app_label": "novinky", "ct_model": "novinky" }, { diff --git a/mamweb/settings_common.py b/mamweb/settings_common.py index d5b35281..92124364 100644 --- a/mamweb/settings_common.py +++ b/mamweb/settings_common.py @@ -149,6 +149,7 @@ INSTALLED_APPS = ( 'treenode', 'vyroci', 'sifrovacka', + 'novinky', # Admin upravy: diff --git a/novinky/__init__.py b/novinky/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/novinky/admin.py b/novinky/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/novinky/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/novinky/apps.py b/novinky/apps.py new file mode 100644 index 00000000..1b728573 --- /dev/null +++ b/novinky/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + +class NovinkyConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'novinky' diff --git a/novinky/migrations/0001_initial.py b/novinky/migrations/0001_initial.py new file mode 100644 index 00000000..0503402c --- /dev/null +++ b/novinky/migrations/0001_initial.py @@ -0,0 +1,45 @@ +# Generated by Django 4.2.13 on 2024-05-13 20:43 + +from django.db import migrations, models + +def nastav_nove_contenttypes(apps, schema_editor): + ContentType = apps.get_model('contenttypes', 'ContentType') + for m in ('novinka'): + oct = ContentType.objects.filter(app_label='seminar', model=m) + oct.update(app_label='novinky') + +def nastav_stare_contenttypes(apps, schema_editor): + ContentType = apps.get_model('contenttypes', 'ContentType') + for m in ('novinka'): + nct = ContentType.objects.filter(app_label='novinky', model=m) + nct.update(app_label='seminar') + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('seminar', '0127_unmanage_novinky'), + ] + + operations = [ + migrations.RunPython(nastav_nove_contenttypes, nastav_stare_contenttypes), + migrations.CreateModel( + name='Novinky', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('datum', models.DateField(auto_now_add=True)), + ('text', models.TextField(blank=True, null=True, verbose_name='Text novinky')), + ('obrazek', models.ImageField(blank=True, null=True, upload_to='image_novinky/%Y/%m/%d/', verbose_name='Obrázek')), + ('autor', models.ForeignKey(to='personalni.organizator', verbose_name='Autor novinky', null=True, on_delete=models.SET_NULL)), + ('zverejneno', models.BooleanField(default=False, verbose_name='Zveřejněno')), + ], + options={ + 'verbose_name': 'Novinka', + 'verbose_name_plural': 'Novinky', + 'db_table': 'seminar_novinky', + 'ordering': ['-datum'], + 'managed': False, + }, + ), + ] diff --git a/novinky/migrations/0002_manage_novinky.py b/novinky/migrations/0002_manage_novinky.py new file mode 100644 index 00000000..6c69fe6e --- /dev/null +++ b/novinky/migrations/0002_manage_novinky.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.13 on 2024-05-13 20:58 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('novinky', '0001_initial'), + ('seminar', '0128_delete_novinky'), + ] + + operations = [ + migrations.AlterModelOptions( + name='novinky', + options={'ordering': ['-datum'], 'verbose_name': 'Novinka', 'verbose_name_plural': 'Novinky'}, + ), + ] diff --git a/novinky/migrations/0003_novinky_post.py b/novinky/migrations/0003_novinky_post.py new file mode 100644 index 00000000..63cef737 --- /dev/null +++ b/novinky/migrations/0003_novinky_post.py @@ -0,0 +1,13 @@ +# Generated by Django 4.2.13 on 2024-05-13 21:00 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('novinky', '0002_manage_novinky'), + ] + + operations = [ + ] diff --git a/novinky/migrations/__init__.py b/novinky/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/seminar/models/novinky.py b/novinky/models.py similarity index 97% rename from seminar/models/novinky.py rename to novinky/models.py index b67bdfe6..b08faacb 100644 --- a/seminar/models/novinky.py +++ b/novinky/models.py @@ -13,6 +13,7 @@ class Novinky(models.Model): verbose_name = 'Novinka' verbose_name_plural = 'Novinky' ordering = ['-datum'] + db_table = 'seminar_novinky' datum = models.DateField(auto_now_add=True) diff --git a/novinky/tests.py b/novinky/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/novinky/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/novinky/views.py b/novinky/views.py new file mode 100644 index 00000000..91ea44a2 --- /dev/null +++ b/novinky/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/personalni/migrations/0007_novinky_pre.py b/personalni/migrations/0007_novinky_pre.py new file mode 100644 index 00000000..c04d481e --- /dev/null +++ b/personalni/migrations/0007_novinky_pre.py @@ -0,0 +1,13 @@ +# Generated by Django 4.2.13 on 2024-05-13 20:35 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('personalni', '0006_pre_split_soustredeni'), + ] + + operations = [ + ] diff --git a/personalni/migrations/0008_novinky_post.py b/personalni/migrations/0008_novinky_post.py new file mode 100644 index 00000000..9d30e7cf --- /dev/null +++ b/personalni/migrations/0008_novinky_post.py @@ -0,0 +1,14 @@ +# Generated by Django 4.2.13 on 2024-05-13 20:59 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('personalni', '0007_novinky_pre'), + ('novinky', '0003_novinky_post'), + ] + + operations = [ + ] diff --git a/seminar/migrations/0126_novinky_pre.py b/seminar/migrations/0126_novinky_pre.py new file mode 100644 index 00000000..1729d176 --- /dev/null +++ b/seminar/migrations/0126_novinky_pre.py @@ -0,0 +1,14 @@ +# Generated by Django 4.2.13 on 2024-05-13 20:36 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0125_post_split_soustredeni'), + ('personalni', '0007_novinky_pre'), + ] + + operations = [ + ] diff --git a/seminar/migrations/0127_unmanage_novinky.py b/seminar/migrations/0127_unmanage_novinky.py new file mode 100644 index 00000000..afca5443 --- /dev/null +++ b/seminar/migrations/0127_unmanage_novinky.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.13 on 2024-05-13 20:41 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0126_novinky_pre'), + ] + + operations = [ + migrations.AlterModelOptions( + name='novinky', + options={'managed': False, 'ordering': ['-datum'], 'verbose_name': 'Novinka', 'verbose_name_plural': 'Novinky'}, + ), + ] diff --git a/seminar/migrations/0128_delete_novinky.py b/seminar/migrations/0128_delete_novinky.py new file mode 100644 index 00000000..9708a09a --- /dev/null +++ b/seminar/migrations/0128_delete_novinky.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.13 on 2024-05-13 20:54 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0127_unmanage_novinky'), + ('novinky', '0001_initial'), + ] + + operations = [ + migrations.DeleteModel( + name='Novinky', + ), + ] diff --git a/seminar/migrations/0129_novinky_post.py b/seminar/migrations/0129_novinky_post.py new file mode 100644 index 00000000..11b2b587 --- /dev/null +++ b/seminar/migrations/0129_novinky_post.py @@ -0,0 +1,14 @@ +# Generated by Django 4.2.13 on 2024-05-13 20:59 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0128_delete_novinky'), + ('novinky', '0003_novinky_post'), + ] + + operations = [ + ] diff --git a/seminar/models/__init__.py b/seminar/models/__init__.py index 121aeb04..e404864a 100644 --- a/seminar/models/__init__.py +++ b/seminar/models/__init__.py @@ -3,11 +3,11 @@ from .odevzdavatko import * from .base import * from .pomocne import * from .treenode import * -from .novinky import * from various.models import Nastaveni from personalni.models import Organizator, Resitel, Skola, Prijemce, Osoba from soustredeni.models import Soustredeni, Soustredeni_Ucastnici, Soustredeni_Organizatori, Konfera, Konfery_Ucastnici +from novinky.models import Novinky # Kvůli migr. 0041 from soustredeni.models import generate_filename_konfera From 7e6dd72722a75205e1164e7c472dea9a706be9b6 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 13 May 2024 23:13:51 +0200 Subject: [PATCH 02/49] =?UTF-8?q?P=C5=99esunut=C3=AD=20admina=20pro=20novi?= =?UTF-8?q?nky?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- novinky/admin.py | 4 +++- seminar/admin.py | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/novinky/admin.py b/novinky/admin.py index 8c38f3f3..ea822bca 100644 --- a/novinky/admin.py +++ b/novinky/admin.py @@ -1,3 +1,5 @@ from django.contrib import admin -# Register your models here. +from .models import Novinky + +admin.site.register(Novinky) diff --git a/seminar/admin.py b/seminar/admin.py index 8f589a03..deaba97f 100644 --- a/seminar/admin.py +++ b/seminar/admin.py @@ -186,4 +186,3 @@ class ResitelInline(admin.TabularInline): # admin.site.register(m.Pohadka) admin.site.register(m.Obrazek) admin.site.register(m.Nastaveni, SingletonModelAdmin) -admin.site.register(m.Novinky) From e618d390de20365dec01fe3cb1317d8b487932d9 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 13 May 2024 23:44:26 +0200 Subject: [PATCH 03/49] =?UTF-8?q?Orgorozcestn=C3=ADk=20pou=C5=BE=C3=ADv?= =?UTF-8?q?=C3=A1=20urls,=20ne=20hardcodovan=C3=A9=20cesty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../personalni/profil/orgorozcestnik.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/personalni/templates/personalni/profil/orgorozcestnik.html b/personalni/templates/personalni/profil/orgorozcestnik.html index 34c4daba..46a26826 100644 --- a/personalni/templates/personalni/profil/orgorozcestnik.html +++ b/personalni/templates/personalni/profil/orgorozcestnik.html @@ -13,18 +13,18 @@
  • soustředění
  • -
  • přidat novinku na web
  • +
  • přidat novinku na web

  • Tvorba čísla

      -
    • přidat téma
    • +
    • přidat téma
    • korektury
    • @@ -70,15 +70,15 @@

      Soustředění

        -
      • přidat soustředění
      • +
      • přidat soustředění
      • přednášky
      • -
      • proběhlá soustředění +
      • proběhlá soustředění
        • vytvoření galerie
        • stažení seznamu účastníků
        • @@ -91,7 +91,7 @@

          Můj profil


          @@ -108,6 +108,6 @@

        -

        Nemůžeš najít, co hledáš? Může to být v administračním rozhraní webu.

        +

        Nemůžeš najít, co hledáš? Může to být v administračním rozhraní webu.

        {% endblock content %} From 2ce45b3d897abf7a7874924f00ff025c7688194c Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 13 May 2024 23:44:54 +0200 Subject: [PATCH 04/49] =?UTF-8?q?Co=20dal=C5=A1=C3=ADho=20nezapomenout=20p?= =?UTF-8?q?=C5=99i=20odst=C5=99elu=20aplikac=C3=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- split-apps-meta/other | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 split-apps-meta/other diff --git a/split-apps-meta/other b/split-apps-meta/other new file mode 100644 index 00000000..68d320e2 --- /dev/null +++ b/split-apps-meta/other @@ -0,0 +1,6 @@ +admin +práva +aplikovat práva +orgorozcestník a další reverzované urls + +výhledově smazat ze seminare From 607129a8995a1265494f97012563543da282928e Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 13 May 2024 23:45:47 +0200 Subject: [PATCH 05/49] =?UTF-8?q?=C3=9Aprava=20orgorozcestn=C3=ADku?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- personalni/templates/personalni/profil/orgorozcestnik.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/personalni/templates/personalni/profil/orgorozcestnik.html b/personalni/templates/personalni/profil/orgorozcestnik.html index 46a26826..90d5867d 100644 --- a/personalni/templates/personalni/profil/orgorozcestnik.html +++ b/personalni/templates/personalni/profil/orgorozcestnik.html @@ -13,7 +13,7 @@
      • soustředění
    • -
    • přidat novinku na web
    • +
    • přidat novinku na web

    From a3a9c629d8c0280064011a02555f323a2aae734a Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Sat, 13 Apr 2024 15:36:21 +0200 Subject: [PATCH 06/49] =?UTF-8?q?Reforma=20pohlav=C3=AD,=20I=20guess?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- odevzdavatko/views.py | 2 +- personalni/forms.py | 2 +- .../templates/personalni/udaje/udaje.html | 2 +- personalni/views.py | 10 ++--- seminar/migrations/0115_reforma_pohlavi.py | 40 +++++++++++++++++++ seminar/models/personalni.py | 22 ++++++++-- seminar/testutils.py | 16 ++++---- seminar/utils.py | 2 +- seminar/views/views_all.py | 4 +- 9 files changed, 79 insertions(+), 21 deletions(-) create mode 100644 seminar/migrations/0115_reforma_pohlavi.py diff --git a/odevzdavatko/views.py b/odevzdavatko/views.py index 41af1dcb..e5de47c2 100644 --- a/odevzdavatko/views.py +++ b/odevzdavatko/views.py @@ -504,7 +504,7 @@ class NahrajReseniView(LoginRequiredMixin, CreateView): EmailMessage( subject="Nové řešení k " + seznam_do_subjectu, - body=f"Řešitel{ '' if resitel.pohlavi_muz else 'ka' } { resitel } právě nahrál{'' if resitel.pohlavi_muz else 'a' } nové řešení k { seznam }.\n\nHurá do opravování: { self.object.absolute_url() }", + body=f"{resitel} posílá nové řešení k { seznam }.\n\nHurá do opravování: { self.object.absolute_url() }", from_email="submitovatko@mam.mff.cuni.cz", # FIXME: Chceme to mít radši tady, nebo v nastavení? to=list(prijemci), ).send() diff --git a/personalni/forms.py b/personalni/forms.py index 3199a8a2..ea0891e7 100644 --- a/personalni/forms.py +++ b/personalni/forms.py @@ -32,7 +32,7 @@ class UdajeForm(forms.Form): jmeno = forms.CharField(label='Jméno', max_length=256, required=True) prezdivka_resitele = forms.CharField(label='Přezdívka (veřejná)', max_length=256, required=False) prijmeni = forms.CharField(label='Příjmení', max_length=256, required=True) - pohlavi_muz = forms.ChoiceField(label='Pohlaví', choices=((True, 'muž'), (False, 'žena')), required=True) + osloveni = forms.ChoiceField(label='Oslovení', choices=Osoba.OSLOVENI_CHOICES, required=False) email = forms.EmailField(label='E-mail', max_length=256, required=True) telefon = forms.CharField(widget=TelInput(), label='Telefon', max_length=256, required=False) datum_narozeni = forms.DateField(widget=DateInput(), label='Datum narození', required=False) diff --git a/personalni/templates/personalni/udaje/udaje.html b/personalni/templates/personalni/udaje/udaje.html index f39e8b47..894ddaf9 100644 --- a/personalni/templates/personalni/udaje/udaje.html +++ b/personalni/templates/personalni/udaje/udaje.html @@ -24,7 +24,7 @@ {% include "personalni/udaje/prihlaska_field.html" with field=form.jmeno %} {% include "personalni/udaje/prihlaska_field.html" with field=form.prezdivka_resitele %} {% include "personalni/udaje/prihlaska_field.html" with field=form.prijmeni %} - {% include "personalni/udaje/prihlaska_field.html" with field=form.pohlavi_muz%} + {% include "personalni/udaje/prihlaska_field.html" with field=form.osloveni%} {% include "personalni/udaje/prihlaska_field.html" with field=form.email %} {% include "personalni/udaje/prihlaska_field.html" with field=form.telefon %} {% include "personalni/udaje/prihlaska_field.html" with field=form.datum_narozeni %} diff --git a/personalni/views.py b/personalni/views.py index 876cc7ec..5e5ad22c 100644 --- a/personalni/views.py +++ b/personalni/views.py @@ -139,7 +139,7 @@ def resitelEditView(request): form_logger.info("EDIT:" + str(fcd) + str(form_hash)) # TODO možná logovat jinak osoba_edit.jmeno = fcd['jmeno'] osoba_edit.prijmeni = fcd['prijmeni'] - osoba_edit.pohlavi_muz = fcd['pohlavi_muz'] + osoba_edit.osloveni = fcd['osloveni'] osoba_edit.email = fcd['email'] osoba_edit.telefon = fcd['telefon'] osoba_edit.ulice = fcd['ulice'] @@ -209,7 +209,7 @@ def prihlaskaView(request): o = s.Osoba( jmeno = fcd['jmeno'], prijmeni = fcd['prijmeni'], - pohlavi_muz = fcd['pohlavi_muz'], + osloveni = fcd['osloveni'], email = fcd['email'], telefon = fcd.get('telefon',''), datum_narozeni = fcd.get('datum_narozeni',None), @@ -242,7 +242,7 @@ def prihlaskaView(request): # Porovnání údajů assert orig_osoba.user is None, "Právě-registrující-se osoba už má Uživatele!" - osoba_attrs = ['jmeno', 'prijmeni', 'pohlavi_muz', 'email', 'telefon', 'datum_narozeni', 'ulice', 'mesto', 'psc', 'stat', 'datum_souhlasu_udaje', 'datum_souhlasu_zasilani', 'datum_registrace'] + osoba_attrs = ['jmeno', 'prijmeni', 'osloveni', 'email', 'telefon', 'datum_narozeni', 'ulice', 'mesto', 'psc', 'stat', 'datum_souhlasu_udaje', 'datum_souhlasu_zasilani', 'datum_registrace'] diffattrs = [] for attr in osoba_attrs: new = getattr(o, attr) @@ -339,7 +339,7 @@ def dataResiteluCsvResponse(queryset, columns=None, with_header=True): 'osoba__telefon', 'osoba__user__username', 'osoba__datum_narozeni', - 'osoba__pohlavi_muz', + 'osoba__osloveni', 'osoba__ulice', 'osoba__mesto', 'osoba__psc', @@ -367,7 +367,7 @@ def dataResiteluCsvResponse(queryset, columns=None, with_header=True): 'osoba__telefon': 'telefon', 'osoba__user__username': 'user', 'osoba__datum_narozeni': 'datum_narozeni', - 'osoba__pohlavi_muz': 'pohlavi_muz', + 'osoba__osloveni': 'osloveni', 'osoba__ulice': 'ulice', 'osoba__mesto': 'mesto', 'osoba__psc': 'psc', diff --git a/seminar/migrations/0115_reforma_pohlavi.py b/seminar/migrations/0115_reforma_pohlavi.py new file mode 100644 index 00000000..3a0f72fd --- /dev/null +++ b/seminar/migrations/0115_reforma_pohlavi.py @@ -0,0 +1,40 @@ +# Generated by Django 4.2.11 on 2024-04-12 14:03 + +from django.db import migrations, models + +# V migracích nemáme Osoba.OSLOVENI_*, tak si to sem nakopíruji. +OSLOVENI_MUZSKE = 'resitel' +OSLOVENI_ZENSKE = 'resitelka' +OSLOVENI_ZADNE = '' + +def pohlavi_to_osloveni(apps, schema_editor): + Osoba = apps.get_model('seminar', 'Osoba') + Osoba.objects.filter(pohlavi_muz=True).update(osloveni=OSLOVENI_MUZSKE) + Osoba.objects.filter(pohlavi_muz=False).update(osloveni=OSLOVENI_ZENSKE) + +def osloveni_to_pohlavi(apps, schema_editor): + Osoba = apps.get_model('seminar', 'Osoba') + nebinarni = Osoba.objects.filter(osloveni=OSLOVENI_ZADNE) + if nebinarni.count() > 0: + raise Exception("Nelze odmigrovat: v databázi jsou nebinární osoby, které starý model nereprezentuje správně.") + Osoba.objects.filter(osloveni=OSLOVENI_MUZSKE).update(pohlavi_muz=True) + Osoba.objects.filter(osloveni=OSLOVENI_MUZSKE).update(pohlavi_muz=False) + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0114_related_name_se_zmenilo_a_django_chce_migraci_tak_dostane_migraci'), + ] + + operations = [ + migrations.AddField( + model_name='osoba', + name='osloveni', + field=models.CharField(blank=True, choices=[('resitel', 'Řešitel'), ('resitelka', 'Řešitelka')], max_length=32, verbose_name='Oslovení'), + ), + migrations.RunPython(pohlavi_to_osloveni, osloveni_to_pohlavi), + migrations.RemoveField( + model_name='osoba', + name='pohlavi_muz', + ), + ] diff --git a/seminar/models/personalni.py b/seminar/models/personalni.py index 61313e87..f93e35b0 100644 --- a/seminar/models/personalni.py +++ b/seminar/models/personalni.py @@ -38,8 +38,16 @@ class Osoba(SeminarModelBase): user = models.OneToOneField(settings.AUTH_USER_MODEL, blank=True, null=True, verbose_name='uživatel', on_delete=models.DO_NOTHING) - # Pohlaví. Že ho neznáme se snad nestane (a ušetří to práci při programování) - pohlavi_muz = models.BooleanField('pohlaví (muž)', default=False) + # Pohlaví nás prakticky nezajímá, reálně. + OSLOVENI_MUZSKE = 'resitel' + OSLOVENI_ZENSKE = 'resitelka' + OSLOVENI_ZADNE = '' + OSLOVENI_CHOICES = [ + (OSLOVENI_MUZSKE, 'Řešitel'), + (OSLOVENI_ZENSKE, 'Řešitelka'), + (OSLOVENI_ZADNE, 'Cokoliv jiného'), # Reálně nás u nikoho jiného oslovení nezajímá? (A pohlaví už vůbec) + ] + osloveni = models.CharField('Oslovení', choices=OSLOVENI_CHOICES, max_length=32, blank=True) email = models.EmailField('e-mail', max_length=256, blank=True, default='') @@ -246,11 +254,19 @@ class Resitel(SeminarModelBase): def export_row(self): "Slovnik pro pouziti v AESOP exportu" + # Ref: https://opmk.mff.cuni.cz/wiki/aesop/import#telo + + # FUJ: Oslovení nemusí souviset s genderem. + gender = { + Osoba.OSLOVENI_MUZSKE: 'M', + Osoba.OSLOVENI_ZENSKE: 'F', + Osoba.OSLOVENI_ZADNE: '', + }[self.osoba.osloveni] return { 'id': self.id, 'name': self.osoba.jmeno, 'surname': self.osoba.prijmeni, - 'gender': 'M' if self.osoba.pohlavi_muz else 'F', + 'gender': gender, 'born': self.osoba.datum_narozeni.isoformat() if self.osoba.datum_narozeni else '', 'email': self.osoba.email, 'end-year': self.rok_maturity or '', diff --git a/seminar/testutils.py b/seminar/testutils.py index c3d64f56..0d90456a 100644 --- a/seminar/testutils.py +++ b/seminar/testutils.py @@ -58,17 +58,19 @@ def gen_osoby(rnd, size): # 30 je náhodná konstanta, size je použité na víc místech a # říká, jak velká asi chceme testovací data for i in range(30 * size): - pohlavi = rnd.randint(0,1) - jmeno = rnd.choice([jmena_m, jmena_f][pohlavi]) - prijmeni = rnd.choice([prijmeni_m, prijmeni_f][pohlavi]) + pohlavi_idx = rnd.randint(0,2) # 2 = nebinární + osloveni = [Osoba.OSLOVENI_MUZSKE, Osoba.OSLOVENI_ZENSKE, Osoba.OSLOVENI_ZADNE][pohlavi_idx] + jmeno = rnd.choice([jmena_m, jmena_f, jmena_m + jmena_f][pohlavi_idx]) + prijmeni = rnd.choice([prijmeni_m, prijmeni_f, prijmeni_m + prijmeni_f][pohlavi_idx]) + if pohlavi_idx == 2: logger.debug(f'Testdata: nebinární osoba: {jmeno} {prijmeni}.') pokusy = 0 max_pokusy = 120*size while (not __unikatni_jmeno and pokusy < max_pokusy): # pokud jméno a příjmení není unikátní, zkoušíme generovat nová # do daného limitu (abychom se nezacyklili do nekonečna při málo jménech a příjmeních # ze kterých se generuje) - jmeno = rnd.choice([jmena_m, jmena_f][pohlavi]) - prijmeni = rnd.choice([prijmeni_m, prijmeni_f][pohlavi]) + jmeno = rnd.choice([jmena_m, jmena_f, jmena_m + jmena_f][pohlavi_idx]) + prijmeni = rnd.choice([prijmeni_m, prijmeni_f, prijmeni_m + prijmeni_f][pohlavi_idx]) pokusy = pokusy + 1 if pokusy >= max_pokusy: print("Chyba, na danou velikost testovacích dat příliš málo možných" @@ -86,7 +88,7 @@ def gen_osoby(rnd, size): psc = "".join([str(rnd.choice([k for k in range(10)])) for i in range(5)]) osoby.append(Osoba.objects.create(jmeno = jmeno, prijmeni = prijmeni, - prezdivka = prezdivka, pohlavi_muz = pohlavi, email = email, + prezdivka = prezdivka, osloveni = osloveni, email = email, telefon = telefon, datum_narozeni = narozeni, ulice = ulice, mesto = mesto, psc = psc, datum_registrace = datetime.date(rnd.randint(2019, 2029), @@ -818,7 +820,7 @@ def create_test_data(size = 6, rnd = None): admin = User.objects.create_superuser(username='admin', email='', password='admin') os_admin = Osoba.objects.create( user=admin, jmeno='admin', prijmeni='admin', - prezdivka='admin', pohlavi_muz=1, email='admin@admin.admin', + prezdivka='admin', osloveni='', email='admin@admin.admin', telefon='123 456 789', datum_narozeni=datetime.date(2000, 1, 1), ulice='admin', mesto='admin', psc='100 00', datum_registrace=datetime.date(2020, 9, 6) diff --git a/seminar/utils.py b/seminar/utils.py index 891f8c15..ddce769c 100644 --- a/seminar/utils.py +++ b/seminar/utils.py @@ -337,7 +337,7 @@ def merge_osoby(cilova, zdrojova): # ID, User neřešíme, poznámku vyřešíme separátně. fieldy = ['datum_narozeni', 'datum_registrace', 'datum_souhlasu_udaje', 'datum_souhlasu_zasilani', 'email', 'foto', 'jmeno', 'mesto', - 'pohlavi_muz', 'prezdivka', 'prijmeni', 'psc', 'stat', 'telefon', 'ulice'] + 'osloveni', 'prezdivka', 'prijmeni', 'psc', 'stat', 'telefon', 'ulice'] for f in fieldy: zf = getattr(zdrojova, f) cf = getattr(cilova, f) diff --git a/seminar/views/views_all.py b/seminar/views/views_all.py index 662c5025..31cfbe17 100644 --- a/seminar/views/views_all.py +++ b/seminar/views/views_all.py @@ -674,8 +674,8 @@ class ClankyResitelView(generic.ListView): def StavDatabazeView(request): # nastaveni = Nastaveni.objects.get() problemy = utils.seznam_problemu() - muzi = Resitel.objects.filter(osoba__pohlavi_muz=True) - zeny = Resitel.objects.filter(osoba__pohlavi_muz=False) + muzi = Resitel.objects.filter(osoba__osloveni=m.Osoba.OSLOVENI_MUZSKE) + zeny = Resitel.objects.filter(osoba__osloveni=m.Osoba.OSLOVENI_ZENSKE) return render(request, 'seminar/stav_databaze.html', { # 'nastaveni': nastaveni, From 8949424f48a6a388963ed2be1b7d0acc93ef8f3c Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Tue, 21 May 2024 21:33:25 +0200 Subject: [PATCH 07/49] =?UTF-8?q?Zapomenut=C3=A1=20migrace=20post=5Fsous?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0007_post_split_soustredeni.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 personalni/migrations/0007_post_split_soustredeni.py diff --git a/personalni/migrations/0007_post_split_soustredeni.py b/personalni/migrations/0007_post_split_soustredeni.py new file mode 100644 index 00000000..a4b8063e --- /dev/null +++ b/personalni/migrations/0007_post_split_soustredeni.py @@ -0,0 +1,13 @@ +# Generated by Django 4.2.11 on 2024-04-30 21:53 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('soustredeni', '0003_post_split_soustredeni'), + ] + + operations = [ + ] From bb1fb87665f81bd7d612f7dc2c8dd64aed502fbd Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Tue, 21 May 2024 21:33:42 +0200 Subject: [PATCH 08/49] =?UTF-8?q?Oprava=20migrace=20kolem=20pohlav=C3=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0008_reforma_pohlavi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename seminar/migrations/0115_reforma_pohlavi.py => personalni/migrations/0008_reforma_pohlavi.py (88%) diff --git a/seminar/migrations/0115_reforma_pohlavi.py b/personalni/migrations/0008_reforma_pohlavi.py similarity index 88% rename from seminar/migrations/0115_reforma_pohlavi.py rename to personalni/migrations/0008_reforma_pohlavi.py index 3a0f72fd..ed0862f5 100644 --- a/seminar/migrations/0115_reforma_pohlavi.py +++ b/personalni/migrations/0008_reforma_pohlavi.py @@ -8,12 +8,12 @@ OSLOVENI_ZENSKE = 'resitelka' OSLOVENI_ZADNE = '' def pohlavi_to_osloveni(apps, schema_editor): - Osoba = apps.get_model('seminar', 'Osoba') + Osoba = apps.get_model('personalni', 'Osoba') Osoba.objects.filter(pohlavi_muz=True).update(osloveni=OSLOVENI_MUZSKE) Osoba.objects.filter(pohlavi_muz=False).update(osloveni=OSLOVENI_ZENSKE) def osloveni_to_pohlavi(apps, schema_editor): - Osoba = apps.get_model('seminar', 'Osoba') + Osoba = apps.get_model('personalni', 'Osoba') nebinarni = Osoba.objects.filter(osloveni=OSLOVENI_ZADNE) if nebinarni.count() > 0: raise Exception("Nelze odmigrovat: v databázi jsou nebinární osoby, které starý model nereprezentuje správně.") @@ -23,7 +23,7 @@ def osloveni_to_pohlavi(apps, schema_editor): class Migration(migrations.Migration): dependencies = [ - ('seminar', '0114_related_name_se_zmenilo_a_django_chce_migraci_tak_dostane_migraci'), + ('personalni', '0007_post_split_soustredeni'), ] operations = [ From 6165c5916bd8a9c811a86cb950566aeb64950cd4 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Tue, 21 May 2024 21:35:06 +0200 Subject: [PATCH 09/49] =?UTF-8?q?Zapomenut=C3=A1=20z=C3=A1vislost?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- personalni/migrations/0007_post_split_soustredeni.py | 1 + 1 file changed, 1 insertion(+) diff --git a/personalni/migrations/0007_post_split_soustredeni.py b/personalni/migrations/0007_post_split_soustredeni.py index a4b8063e..afdf0896 100644 --- a/personalni/migrations/0007_post_split_soustredeni.py +++ b/personalni/migrations/0007_post_split_soustredeni.py @@ -6,6 +6,7 @@ from django.db import migrations class Migration(migrations.Migration): dependencies = [ + ('personalni', '0006_pre_split_soustredeni'), ('soustredeni', '0003_post_split_soustredeni'), ] From 8dbb92d3a4e779121c56bfca5d35117ce0a4cc1e Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Sun, 2 Jun 2024 17:17:57 +0200 Subject: [PATCH 10/49] =?UTF-8?q?Filtrov=C3=A1ni=20=C5=99e=C5=A1itel=C5=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- personalni/admin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/personalni/admin.py b/personalni/admin.py index 14af2c2c..b3506fc4 100644 --- a/personalni/admin.py +++ b/personalni/admin.py @@ -53,6 +53,7 @@ class OrganizatorAdmin(ReverseModelAdmin): @admin.register(m.Resitel) class ResitelAdmin(ReverseModelAdmin): search_fields = ['osoba__jmeno', 'osoba__prijmeni', 'osoba__prezdivka'] + list_filter = ['zasilat', 'zasilat_cislo_papirove', 'zasilat_cislo_emailem', 'rok_maturity'] ordering = ('osoba__prijmeni', 'osoba__jmeno') inline_type = 'stacked' inline_reverse = ['osoba'] From e431e23ad42467abd9b82c0bef713eea4cb3ab53 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Sun, 2 Jun 2024 18:08:18 +0200 Subject: [PATCH 11/49] =?UTF-8?q?Vyr=C3=A1b=C4=9Bn=C3=AD=20org=C5=AF=20z?= =?UTF-8?q?=20=C5=99e=C5=A1itel=C5=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- personalni/admin.py | 50 +++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/personalni/admin.py b/personalni/admin.py index b3506fc4..81cf7ecb 100644 --- a/personalni/admin.py +++ b/personalni/admin.py @@ -5,10 +5,31 @@ from django.contrib.messages import WARNING, ERROR, SUCCESS import seminar.models as m from datetime import datetime +# Tohle chceme umět použít i z ResitelAdmin +@admin.action(description="Udělej z vybraných osob organizátory") +def udelej_orgem(admin, request, queryset): + org_group = Group.objects.get(name='org') + uspesne_vytvoreni_orgove = 0 + for o in queryset: + if m.Organizator.objects.filter(osoba=o).exists(): + # Ref: https://docs.djangoproject.com/en/3.2/ref/contrib/admin/#django.contrib.admin.ModelAdmin.message_user + admin.message_user(request, f"Osoba {o} už je org, přeskakuji.", level=WARNING) + continue + user = o.user + if user is None: + admin.message_user(request, f"Osoba {o} nemá uživatele! Přeskakuji.", level=ERROR) + continue + user.groups.add(org_group) + user.is_staff = True + user.save() + org = m.Organizator.objects.create(osoba=o, organizuje_od=datetime.now()) + org.save() + uspesne_vytvoreni_orgove += 1 + admin.message_user(request, f'Úspěšně vytvořeno {uspesne_vytvoreni_orgove} orgů.', level=SUCCESS) @admin.register(m.Osoba) class OsobaAdmin(admin.ModelAdmin): - actions = ['synchronizuj_maily', 'udelej_orgem'] + actions = ['synchronizuj_maily', udelej_orgem] search_fields = ['jmeno', 'prijmeni', 'prezdivka'] def synchronizuj_maily(self, request, queryset): @@ -20,27 +41,6 @@ class OsobaAdmin(admin.ModelAdmin): self.message_user(request, "E-maily synchronizovány.") synchronizuj_maily.short_description = "Synchronizuj vybraným osobám e-maily do uživatelů" - def udelej_orgem(self,request,queryset): - org_group = Group.objects.get(name='org') - uspesne_vytvoreni_orgove = 0 - for o in queryset: - if m.Organizator.objects.filter(osoba=o).exists(): - # Ref: https://docs.djangoproject.com/en/3.2/ref/contrib/admin/#django.contrib.admin.ModelAdmin.message_user - self.message_user(request, f"Osoba {o} už je org, přeskakuji.", level=WARNING) - continue - user = o.user - if user is None: - self.message_user(request, f"Osoba {o} nemá uživatele! Přeskakuji.", level=ERROR) - continue - user.groups.add(org_group) - user.is_staff = True - user.save() - org = m.Organizator.objects.create(osoba=o, organizuje_od=datetime.now()) - org.save() - uspesne_vytvoreni_orgove += 1 - self.message_user(request, f'Úspěšně vytvořeno {uspesne_vytvoreni_orgove} orgů.', level=SUCCESS) - udelej_orgem.short_description = "Udělej z vybraných osob organizátory" - class OsobaInline(admin.TabularInline): model = m.Osoba @@ -58,5 +58,11 @@ class ResitelAdmin(ReverseModelAdmin): inline_type = 'stacked' inline_reverse = ['osoba'] + actions = ['udelej_resitele_orgem'] + @admin.action(description="Udělej z řešitelů organizátory") + def udelej_resitele_orgem(self, req, qs): + osoby = m.Osoba.objects.filter(resitel__in=qs) + udelej_orgem(self, req, osoby) + admin.site.register(m.Skola) admin.site.register(m.Prijemce) From 15b09c23a7e5cc4721903859044082d8716c7e37 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Sun, 2 Jun 2024 22:54:28 +0200 Subject: [PATCH 12/49] =?UTF-8?q?Posunut=C3=AD=20odst=C5=99elu=20novinek?= =?UTF-8?q?=20a=C5=BE=20za=20reformu=20pohlav=C3=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/{0007_novinky_pre.py => 0009_novinky_pre.py} | 2 +- .../migrations/{0008_novinky_post.py => 0010_novinky_post.py} | 2 +- seminar/migrations/0126_novinky_pre.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename personalni/migrations/{0007_novinky_pre.py => 0009_novinky_pre.py} (76%) rename personalni/migrations/{0008_novinky_post.py => 0010_novinky_post.py} (83%) diff --git a/personalni/migrations/0007_novinky_pre.py b/personalni/migrations/0009_novinky_pre.py similarity index 76% rename from personalni/migrations/0007_novinky_pre.py rename to personalni/migrations/0009_novinky_pre.py index c04d481e..49a94a93 100644 --- a/personalni/migrations/0007_novinky_pre.py +++ b/personalni/migrations/0009_novinky_pre.py @@ -6,7 +6,7 @@ from django.db import migrations class Migration(migrations.Migration): dependencies = [ - ('personalni', '0006_pre_split_soustredeni'), + ('personalni', '0008_reforma_pohlavi'), ] operations = [ diff --git a/personalni/migrations/0008_novinky_post.py b/personalni/migrations/0010_novinky_post.py similarity index 83% rename from personalni/migrations/0008_novinky_post.py rename to personalni/migrations/0010_novinky_post.py index 9d30e7cf..8c580214 100644 --- a/personalni/migrations/0008_novinky_post.py +++ b/personalni/migrations/0010_novinky_post.py @@ -6,7 +6,7 @@ from django.db import migrations class Migration(migrations.Migration): dependencies = [ - ('personalni', '0007_novinky_pre'), + ('personalni', '0009_novinky_pre'), ('novinky', '0003_novinky_post'), ] diff --git a/seminar/migrations/0126_novinky_pre.py b/seminar/migrations/0126_novinky_pre.py index 1729d176..644abb44 100644 --- a/seminar/migrations/0126_novinky_pre.py +++ b/seminar/migrations/0126_novinky_pre.py @@ -7,7 +7,7 @@ class Migration(migrations.Migration): dependencies = [ ('seminar', '0125_post_split_soustredeni'), - ('personalni', '0007_novinky_pre'), + ('personalni', '0009_novinky_pre'), ] operations = [ From 381c5ca3de96a9ae7c9b4f5a21deaf571ee592ff Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 3 Jun 2024 02:06:00 +0200 Subject: [PATCH 13/49] =?UTF-8?q?Hezk=C3=A1=20jm=C3=A9na=20a=20po=C5=99ad?= =?UTF-8?q?=C3=AD=20aplikac=C3=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aesop/apps.py | 2 +- api/apps.py | 1 + header_fotky/apps.py | 1 + mamweb/admin.py | 13 +++++++++++-- novinky/apps.py | 1 + odevzdavatko/apps.py | 1 + personalni/apps.py | 1 + seminar/apps.py | 7 +++++++ sifrovacka/apps.py | 1 + soustredeni/apps.py | 1 + treenode/apps.py | 1 + various/apps.py | 1 + vyroci/apps.py | 1 + vysledkovky/apps.py | 1 + 14 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 seminar/apps.py diff --git a/aesop/apps.py b/aesop/apps.py index 4e8b4787..d7dea2e3 100644 --- a/aesop/apps.py +++ b/aesop/apps.py @@ -3,6 +3,6 @@ Soubor sloužící k pojmenování a jiným nastavením djangovské aplikace. """ from django.apps import AppConfig - class AesopConfig(AppConfig): name = 'aesop' + verbose_name = 'Export do AESOPa' diff --git a/api/apps.py b/api/apps.py index 6a2bdbc4..a74c8c0e 100644 --- a/api/apps.py +++ b/api/apps.py @@ -6,3 +6,4 @@ from django.apps import AppConfig class ApiConfig(AppConfig): name = 'api' + verbose_name = 'Různá webová API' diff --git a/header_fotky/apps.py b/header_fotky/apps.py index 13f93ed4..9cf572ec 100644 --- a/header_fotky/apps.py +++ b/header_fotky/apps.py @@ -6,3 +6,4 @@ from django.apps import AppConfig class HeaderFotkyConfig(AppConfig): name = 'header_fotky' + verbose_name = 'Fotky v záhlaví' diff --git a/mamweb/admin.py b/mamweb/admin.py index 5d0351df..d905f186 100644 --- a/mamweb/admin.py +++ b/mamweb/admin.py @@ -42,8 +42,17 @@ def get_app_list(self, request, app_label=None): """ app_dict = self._build_app_dict(request, label=app_label) - # Sort the apps alphabetically. - app_list = sorted(app_dict.values(), key=lambda x: locale.strxfrm('!') if (x['name'] == "Seminar") else locale.strxfrm(x['name'].lower())) + aplikace_nahore = [ + 'seminar', + 'personalni', + 'novinky', + 'korektury', + 'various', + 'prednasky', + 'soustredeni', + ] + app_list = [app_dict[label] for label in aplikace_nahore] + [app_dict[label] for label in app_dict if label not in aplikace_nahore] + # Sort the models alphabetically within each app. for app in app_list: diff --git a/novinky/apps.py b/novinky/apps.py index 1b728573..92519305 100644 --- a/novinky/apps.py +++ b/novinky/apps.py @@ -3,3 +3,4 @@ from django.apps import AppConfig class NovinkyConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'novinky' + verbose_name = 'Novinky' diff --git a/odevzdavatko/apps.py b/odevzdavatko/apps.py index 95811247..d20e4a5a 100644 --- a/odevzdavatko/apps.py +++ b/odevzdavatko/apps.py @@ -6,3 +6,4 @@ from django.apps import AppConfig class OdevzdavatkoConfig(AppConfig): name = 'odevzdavatko' + verbose_name = 'Odevzdávátko' diff --git a/personalni/apps.py b/personalni/apps.py index 47ba22cc..a6ea47fa 100644 --- a/personalni/apps.py +++ b/personalni/apps.py @@ -6,3 +6,4 @@ from django.apps import AppConfig class PersonalniConfig(AppConfig): name = 'personalni' + verbose_name = 'Personální' # Má to nějaký použitelnější název? diff --git a/seminar/apps.py b/seminar/apps.py new file mode 100644 index 00000000..161a73f8 --- /dev/null +++ b/seminar/apps.py @@ -0,0 +1,7 @@ +from django.apps import AppConfig + +class SeminarConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'seminar' + verbose_name = 'Seminář' + diff --git a/sifrovacka/apps.py b/sifrovacka/apps.py index e9f34de6..edca3802 100644 --- a/sifrovacka/apps.py +++ b/sifrovacka/apps.py @@ -3,3 +3,4 @@ from django.apps import AppConfig class SifrovackaConfig(AppConfig): name = 'sifrovacka' + verbose_name = 'Šifrovačka' diff --git a/soustredeni/apps.py b/soustredeni/apps.py index a0a8dae5..3dd0b94e 100644 --- a/soustredeni/apps.py +++ b/soustredeni/apps.py @@ -6,3 +6,4 @@ from django.apps import AppConfig class SoustredeniConfig(AppConfig): name = 'soustredeni' + verbose_name = 'Soustředění' diff --git a/treenode/apps.py b/treenode/apps.py index 8e7df6fc..7e709e48 100644 --- a/treenode/apps.py +++ b/treenode/apps.py @@ -6,3 +6,4 @@ from django.apps import AppConfig class TreenodeConfig(AppConfig): name = 'treenode' + verbose_name = 'TreeNody' diff --git a/various/apps.py b/various/apps.py index bf6023f0..d1f6ad2e 100644 --- a/various/apps.py +++ b/various/apps.py @@ -6,3 +6,4 @@ from django.apps import AppConfig class VariousConfig(AppConfig): name = 'various' + verbose_name = 'Různé' diff --git a/vyroci/apps.py b/vyroci/apps.py index b30f5d73..0fb1491e 100644 --- a/vyroci/apps.py +++ b/vyroci/apps.py @@ -3,3 +3,4 @@ from django.apps import AppConfig class VyrociConfig(AppConfig): name = 'vyroci' + verbose_name = '30. výročí M&M' diff --git a/vysledkovky/apps.py b/vysledkovky/apps.py index de1c2bde..7b9a1e0f 100644 --- a/vysledkovky/apps.py +++ b/vysledkovky/apps.py @@ -6,3 +6,4 @@ from django.apps import AppConfig class VysledkovkyConfig(AppConfig): name = 'vysledkovky' + verbose_name = 'Výsledkovky' From c78b932587cc19e502c3a963d7d3e3b1d5042314 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 3 Jun 2024 03:02:06 +0200 Subject: [PATCH 14/49] =?UTF-8?q?Oprava=20odhl=C3=A1=C5=A1en=C3=A9ho=20adm?= =?UTF-8?q?ina?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mamweb/admin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mamweb/admin.py b/mamweb/admin.py index d905f186..04d564cc 100644 --- a/mamweb/admin.py +++ b/mamweb/admin.py @@ -51,7 +51,8 @@ def get_app_list(self, request, app_label=None): 'prednasky', 'soustredeni', ] - app_list = [app_dict[label] for label in aplikace_nahore] + [app_dict[label] for label in app_dict if label not in aplikace_nahore] + # Odhlášený admin má prázdný app_dict :-/ + app_list = [app_dict[label] for label in aplikace_nahore if label in app_dict] + [app_dict[label] for label in app_dict if label not in aplikace_nahore] # Sort the models alphabetically within each app. From c917655a22e5e9aacecfde38932240308cbab550 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 3 Jun 2024 14:02:05 +0200 Subject: [PATCH 15/49] =?UTF-8?q?P=C5=99i=20make/init=5Flocal=20nesyncujem?= =?UTF-8?q?e=20flatpages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Je to otravné a navíc to vyžaduje klíč… --- make/init_local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/init_local b/make/init_local index 1b2f7c1e..76448a3c 100755 --- a/make/init_local +++ b/make/init_local @@ -7,5 +7,5 @@ make/install_web ensure_venv ./manage.py testdata ./manage.py loaddata data/* -make/sync_prod_flatpages +#make/sync_prod_flatpages ./manage.py load_org_permissions deploy_v2/admin_org_prava.json From f75408e936b606ada344874f4081a4a27dae9ee9 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 3 Jun 2024 14:10:41 +0200 Subject: [PATCH 16/49] =?UTF-8?q?fix=20z=C3=A1vislost=C3=AD=20seminar/0117?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/migrations/0117_auto_20240312_2125.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/seminar/migrations/0117_auto_20240312_2125.py b/seminar/migrations/0117_auto_20240312_2125.py index 57b2431f..0134534a 100644 --- a/seminar/migrations/0117_auto_20240312_2125.py +++ b/seminar/migrations/0117_auto_20240312_2125.py @@ -7,9 +7,11 @@ class Migration(migrations.Migration): dependencies = [ ('seminar', '0116_delete_nastaveni'), - ('personalni', '0001_skupiny'), + ('various', '0003_fix_permissions'), # Zapomenutá post-split migrace, suplujeme tady. + ('personalni', '0001_skupiny'), # Mělo být spíš 0002_auto_20240312_2118, ale to je no-op, tak je to jedno. ('korektury', '0021_auto_20240312_2124'), ('sifrovacka', '0004_auto_20240312_2124'), + ('prednasky', '0013_auto_20240312_2124'), ] operations = [ From 067cd073527cb5c32086f2c78e5669182231e2d4 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 3 Jun 2024 16:31:38 +0200 Subject: [PATCH 17/49] =?UTF-8?q?Zapomenut=C3=BD=20choice=20u=20osoby?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../0011_osloveni_vsechny_choices.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 personalni/migrations/0011_osloveni_vsechny_choices.py diff --git a/personalni/migrations/0011_osloveni_vsechny_choices.py b/personalni/migrations/0011_osloveni_vsechny_choices.py new file mode 100644 index 00000000..9b360208 --- /dev/null +++ b/personalni/migrations/0011_osloveni_vsechny_choices.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.13 on 2024-06-03 14:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('personalni', '0010_novinky_post'), + ] + + operations = [ + migrations.AlterField( + model_name='osoba', + name='osloveni', + field=models.CharField(blank=True, choices=[('resitel', 'Řešitel'), ('resitelka', 'Řešitelka'), ('', 'Cokoliv jiného')], max_length=32, verbose_name='Oslovení'), + ), + ] From 491f91cf4704170c1bbbe332da796b91b9cd2297 Mon Sep 17 00:00:00 2001 From: ticvac Date: Sat, 15 Jun 2024 22:54:26 +0200 Subject: [PATCH 18/49] akce na sjednoceni cisel do +420 123 456 78 --- personalni/admin.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/personalni/admin.py b/personalni/admin.py index 81cf7ecb..ecb59674 100644 --- a/personalni/admin.py +++ b/personalni/admin.py @@ -5,6 +5,24 @@ from django.contrib.messages import WARNING, ERROR, SUCCESS import seminar.models as m from datetime import datetime +@admin.action(description="Sjednoť telefony") +def sjednot_telefony(admin, request, queryset): + for o in queryset: + try: + telefon = int(o.telefon.replace(" ", "").replace("+", "")) + # 6 míst + if len(str(telefon)) == 9: + o.telefon = "+420 " + str(telefon)[0:3] + " " + str(telefon)[3:6] + " " + str(telefon)[6:9] + o.save() + # 12 míst + elif len(str(telefon)) == 12: + o.telefon = "+" + str(telefon)[0:3] + " " + str(telefon)[3:6] + " " + str(telefon)[6:9] + " " + str(telefon)[9:12] + o.save() + else: + raise ValueError + except: + print("Hmm má divné číslo - " + o.telefon + " - " + str(o.id)) + # Tohle chceme umět použít i z ResitelAdmin @admin.action(description="Udělej z vybraných osob organizátory") def udelej_orgem(admin, request, queryset): @@ -29,7 +47,7 @@ def udelej_orgem(admin, request, queryset): @admin.register(m.Osoba) class OsobaAdmin(admin.ModelAdmin): - actions = ['synchronizuj_maily', udelej_orgem] + actions = ['synchronizuj_maily', udelej_orgem, sjednot_telefony] search_fields = ['jmeno', 'prijmeni', 'prezdivka'] def synchronizuj_maily(self, request, queryset): From fad2c6940d6a2b755702d457753b8faa746a54e3 Mon Sep 17 00:00:00 2001 From: ticvac Date: Sat, 15 Jun 2024 23:20:35 +0200 Subject: [PATCH 19/49] =?UTF-8?q?oprava=20chybov=C3=A9=20hl=C3=A1=C5=A1ky?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- personalni/admin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/personalni/admin.py b/personalni/admin.py index ecb59674..e86898db 100644 --- a/personalni/admin.py +++ b/personalni/admin.py @@ -21,7 +21,8 @@ def sjednot_telefony(admin, request, queryset): else: raise ValueError except: - print("Hmm má divné číslo - " + o.telefon + " - " + str(o.id)) + admin.message_user(request, f"{o.jmeno} {o.prijmeni} (id: {o.id}) má divný telefon: {o.telefon}", level=ERROR) + admin.message_user(request, "Telefony sjednoceny.", level=SUCCESS) # Tohle chceme umět použít i z ResitelAdmin @admin.action(description="Udělej z vybraných osob organizátory") From cf3c9f6f805dc839f6550bbae74b5abba67bb82c Mon Sep 17 00:00:00 2001 From: ticvac Date: Sat, 15 Jun 2024 23:27:42 +0200 Subject: [PATCH 20/49] prazdy string -> continue --- personalni/admin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/personalni/admin.py b/personalni/admin.py index e86898db..3418769a 100644 --- a/personalni/admin.py +++ b/personalni/admin.py @@ -8,6 +8,8 @@ from datetime import datetime @admin.action(description="Sjednoť telefony") def sjednot_telefony(admin, request, queryset): for o in queryset: + if o.telefon == '': + continue try: telefon = int(o.telefon.replace(" ", "").replace("+", "")) # 6 míst From 3c3b9f755a52c773c3f23006249b5cbac5d26ec2 Mon Sep 17 00:00:00 2001 From: Riki Date: Sat, 15 Jun 2024 23:35:46 +0200 Subject: [PATCH 21/49] Add `strana` column to `Clanek` Optionally add page fragment to `resitelske_clanky.html` --- ..._strana_alter_text_id_alter_treenode_id.py | 28 +++++++++++++++++++ seminar/models/tvorba.py | 2 ++ .../seminar/clanky/resitelske_clanky.html | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 seminar/migrations/0130_clanek_strana_alter_text_id_alter_treenode_id.py diff --git a/seminar/migrations/0130_clanek_strana_alter_text_id_alter_treenode_id.py b/seminar/migrations/0130_clanek_strana_alter_text_id_alter_treenode_id.py new file mode 100644 index 00000000..cc6774d6 --- /dev/null +++ b/seminar/migrations/0130_clanek_strana_alter_text_id_alter_treenode_id.py @@ -0,0 +1,28 @@ +# Generated by Django 4.2.13 on 2024-06-15 21:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0129_novinky_post'), + ] + + operations = [ + migrations.AddField( + model_name='clanek', + name='strana', + field=models.PositiveIntegerField(blank=True, null=True, verbose_name='první strana'), + ), + migrations.AlterField( + model_name='text', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='treenode', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + ] diff --git a/seminar/models/tvorba.py b/seminar/models/tvorba.py index 1dd9db8e..4ef57bde 100644 --- a/seminar/models/tvorba.py +++ b/seminar/models/tvorba.py @@ -600,6 +600,8 @@ class Clanek(Problem): cislo = models.ForeignKey(Cislo, blank=True, null=True, on_delete=models.PROTECT, verbose_name='číslo vydání', related_name='vydane_clanky') + + strana = models.PositiveIntegerField(verbose_name="první strana", blank=True, null=True) @cached_property def kod_v_rocniku(self): diff --git a/seminar/templates/seminar/clanky/resitelske_clanky.html b/seminar/templates/seminar/clanky/resitelske_clanky.html index 2bcc7a6b..558232c0 100644 --- a/seminar/templates/seminar/clanky/resitelske_clanky.html +++ b/seminar/templates/seminar/clanky/resitelske_clanky.html @@ -17,7 +17,7 @@ {% endifchanged %}
  • {% if clanek.cislo.pdf %} - + {{ clanek.nazev }} ({% for r in clanek.reseni_set.first.resitele.all %}{{r}}{% if not forloop.last %}, {% endif %}{% endfor %}) From 6225630f9f949bdb812e8893aadb0bc5251bbeda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Thu, 20 Jun 2024 14:31:58 +0200 Subject: [PATCH 22/49] =?UTF-8?q?Migra=C4=8Dn=C3=AD=20kekel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t_id_alter_treenode_id.py => 0130_clanek_strana.py} | 10 ---------- 1 file changed, 10 deletions(-) rename seminar/migrations/{0130_clanek_strana_alter_text_id_alter_treenode_id.py => 0130_clanek_strana.py} (50%) diff --git a/seminar/migrations/0130_clanek_strana_alter_text_id_alter_treenode_id.py b/seminar/migrations/0130_clanek_strana.py similarity index 50% rename from seminar/migrations/0130_clanek_strana_alter_text_id_alter_treenode_id.py rename to seminar/migrations/0130_clanek_strana.py index cc6774d6..d2f985fb 100644 --- a/seminar/migrations/0130_clanek_strana_alter_text_id_alter_treenode_id.py +++ b/seminar/migrations/0130_clanek_strana.py @@ -15,14 +15,4 @@ class Migration(migrations.Migration): name='strana', field=models.PositiveIntegerField(blank=True, null=True, verbose_name='první strana'), ), - migrations.AlterField( - model_name='text', - name='id', - field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), - ), - migrations.AlterField( - model_name='treenode', - name='id', - field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), - ), ] From 1ce9cb445f66b7002937e6e4b8be64c17ae46bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Thu, 20 Jun 2024 14:38:27 +0200 Subject: [PATCH 23/49] =?UTF-8?q?Tady=20bylo=20=E2=80=9E.cislo=E2=80=9C=20?= =?UTF-8?q?nav=C3=ADc=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/templates/seminar/clanky/resitelske_clanky.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seminar/templates/seminar/clanky/resitelske_clanky.html b/seminar/templates/seminar/clanky/resitelske_clanky.html index 558232c0..0c808bda 100644 --- a/seminar/templates/seminar/clanky/resitelske_clanky.html +++ b/seminar/templates/seminar/clanky/resitelske_clanky.html @@ -17,7 +17,7 @@ {% endifchanged %}
  • {% if clanek.cislo.pdf %} - + {{ clanek.nazev }} ({% for r in clanek.reseni_set.first.resitele.all %}{{r}}{% if not forloop.last %}, {% endif %}{% endfor %}) From 2444e5f985f6bd3c2e7156ec60f1e7a731b0aae3 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 8 Jul 2024 22:39:46 +0200 Subject: [PATCH 24/49] =?UTF-8?q?Nemus=C3=ADm=20shazovat=20web?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- personalni/views.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/personalni/views.py b/personalni/views.py index 5e5ad22c..e7cb4f48 100644 --- a/personalni/views.py +++ b/personalni/views.py @@ -4,7 +4,7 @@ from django.views import generic from django.db.models import Q, Count, Min from django.views.decorators.debug import sensitive_post_parameters from django.views.generic.base import TemplateView -from django.contrib.auth.models import User, Permission, Group +from django.contrib.auth.models import User, Permission, Group, AnonymousUser from django.contrib.auth.mixins import LoginRequiredMixin from django.db import transaction from django.http import HttpResponse @@ -318,6 +318,12 @@ def prihlaskaView(request): # Jen hloupé rozhazovátko def profilView(request): user = request.user + if not isinstance(user, AnonymousUser) and m.Osoba.objects.filter(user=user).count() != 1: + # m.Osoba.objects.get() v ostatních views selže + return HttpResponse(render(request, "universal.html", { + 'title': 'Krize identity.', + 'raw_html': r'
    Zvláštní pocit, že jo?
    […]
    Co to znamená?
    — Že ti MaMweb neumí říct, kdo jsi.
    A Admin ano?
    — V tom je rozdíl.
    — Matrix (1999), parafrázováno', + })) if user.has_perm('auth.org'): return OrgoRozcestnikView.as_view()(request) if user.has_perm('auth.resitel'): From ca8e8506b3d11f66823591de7362dc22776f26ea Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 8 Jul 2024 22:52:58 +0200 Subject: [PATCH 25/49] =?UTF-8?q?P=C5=99ebyte=C4=8Dn=C3=A1=20HttpResponse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- personalni/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/personalni/views.py b/personalni/views.py index e7cb4f48..c2712b30 100644 --- a/personalni/views.py +++ b/personalni/views.py @@ -320,10 +320,10 @@ def profilView(request): user = request.user if not isinstance(user, AnonymousUser) and m.Osoba.objects.filter(user=user).count() != 1: # m.Osoba.objects.get() v ostatních views selže - return HttpResponse(render(request, "universal.html", { + return render(request, "universal.html", { 'title': 'Krize identity.', 'raw_html': r'
    Zvláštní pocit, že jo?
    […]
    Co to znamená?
    — Že ti MaMweb neumí říct, kdo jsi.
    A Admin ano?
    — V tom je rozdíl.
    — Matrix (1999), parafrázováno', - })) + }) if user.has_perm('auth.org'): return OrgoRozcestnikView.as_view()(request) if user.has_perm('auth.resitel'): From 49aea5b8b401294a137f72b4760ea1e2638ab495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Tue, 9 Jul 2024 19:30:32 +0200 Subject: [PATCH 26/49] =?UTF-8?q?Zm=C4=9Bny=20(z=20gimliho)=20v=20konfigur?= =?UTF-8?q?aci=20nginxu,=20kter=C3=A9=20asi=20chceme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup/nginx/mam-test.ks.matfyz.cz | 9 ++++++--- setup/nginx/mam.mff.cuni.cz | 5 ++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/setup/nginx/mam-test.ks.matfyz.cz b/setup/nginx/mam-test.ks.matfyz.cz index 46f9b2ec..90838840 100644 --- a/setup/nginx/mam-test.ks.matfyz.cz +++ b/setup/nginx/mam-test.ks.matfyz.cz @@ -7,11 +7,10 @@ server { } server { # SSL configuration - listen 195.113.20.177:443 ssl; - listen [2001:718:1e03:801::b1]:443 ssl; + listen 195.113.20.177:443 ssl http2; + listen [2001:718:1e03:801::b1]:443 ssl http2; # SSL keys - ssl on; ssl_certificate /etc/letsencrypt/live/mam-test.ks.matfyz.cz/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/mam-test.ks.matfyz.cz/privkey.pem; # managed by Certbot ssl_dhparam /etc/ssl/dhparams.pem; @@ -33,6 +32,10 @@ server { root /akce/mam/www/mamweb-test/; } + location /docs { + alias /akce/mam/www/mamweb-test/docs/_build/html/; + } + location /aesop-export/ { auth_basic "AESOP API"; auth_basic_user_file /akce/mam/www/mamweb-test/.htpasswd-aesop; diff --git a/setup/nginx/mam.mff.cuni.cz b/setup/nginx/mam.mff.cuni.cz index 99292a67..62fc307c 100644 --- a/setup/nginx/mam.mff.cuni.cz +++ b/setup/nginx/mam.mff.cuni.cz @@ -9,11 +9,10 @@ server { server { # SSL configuration # - listen 195.113.20.177:443 ssl; - listen [2001:718:1e03:801::b1]:443 ssl; + listen 195.113.20.177:443 ssl http2; + listen [2001:718:1e03:801::b1]:443 ssl http2; # SSL keys - ssl on; ssl_certificate /etc/ssl/domains/mam.mff.cuni.cz/bundle.pem; ssl_certificate_key /etc/ssl/domains/mam.mff.cuni.cz/privkey.pem; ssl_dhparam /etc/ssl/dhparams.pem; From f564d4e1452fff713f3555aa69edf66681cacc6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Tue, 9 Jul 2024 19:32:09 +0200 Subject: [PATCH 27/49] =?UTF-8?q?Spr=C3=A1vn=C3=BD=20odkaz=20na=20diff=20(?= =?UTF-8?q?na=20wiki)=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup/nginx/mam.mff.cuni.cz | 1 + 1 file changed, 1 insertion(+) diff --git a/setup/nginx/mam.mff.cuni.cz b/setup/nginx/mam.mff.cuni.cz index 62fc307c..5e5ed681 100644 --- a/setup/nginx/mam.mff.cuni.cz +++ b/setup/nginx/mam.mff.cuni.cz @@ -48,6 +48,7 @@ server { sub_filter 'href="/' 'href="/wiki/'; sub_filter 'src="/' 'src="/wiki/'; sub_filter 'action="/' 'action="/wiki/'; + sub_filter 'diffurl="/' 'diffurl="/wiki/'; # Overkill: #sub_filter '="/' '="/wiki/'; #sub_filter ':5001/' '/wiki/'; From ec474530e48cc8fa02510e06cc05561feb9d4aef Mon Sep 17 00:00:00 2001 From: ticvac Date: Fri, 19 Jul 2024 11:41:53 +0200 Subject: [PATCH 28/49] add .DS_store to .gitignore --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d3a2a533..5216e441 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,7 @@ TODO # dokumentace docs/_build -docs/modules \ No newline at end of file +docs/modules + +# Mac users +.DS_Store From 3188e024da432aa7b32926595448b1c2e2972910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Fri, 2 Aug 2024 13:24:29 +0200 Subject: [PATCH 29/49] =?UTF-8?q?Logy=20t=C3=BDrac=C3=ADho=20skriptu=20do?= =?UTF-8?q?=20.gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 5216e441..f70ed3c4 100644 --- a/.gitignore +++ b/.gitignore @@ -31,12 +31,15 @@ TODO # reversion kvůli historii objektů v reversion **/reversion -# pro lidi, co programují v nástrojích od JetBrains -.idea - # dokumentace docs/_build docs/modules +# logy týracího skriptu (./checklinks.sh) +/wget.log.* + +# pro lidi, co programují v nástrojích od JetBrains +.idea + # Mac users .DS_Store From 2bb732959ac84f41f0c163a4235d24ace5b76b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sat, 3 Aug 2024 10:31:20 +0200 Subject: [PATCH 30/49] =?UTF-8?q?Nepou=C5=BE=C3=ADvan=C3=BD=20k=C3=B3d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/utils.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/seminar/utils.py b/seminar/utils.py index ddce769c..7c009210 100644 --- a/seminar/utils.py +++ b/seminar/utils.py @@ -6,7 +6,6 @@ import decimal from django.contrib.auth import get_user_model from django.contrib.auth.decorators import permission_required, \ user_passes_test -from html.parser import HTMLParser from django import views as DjangoViews from django.db import transaction @@ -55,16 +54,6 @@ def inverze_vzorecku_na_prepocet(body: decimal.Decimal, resitelu) -> decimal.Dec return round(body * (resitelu + 2) / 3, 1) -class FirstTagParser(HTMLParser): - def __init__(self, *args, **kwargs): - self.firstTag = None - super().__init__(*args, **kwargs) - - def handle_data(self, data): - if self.firstTag == None: - self.firstTag = data - - def histogram(seznam): d = {} for i in seznam: From 350623c6ac33f3ab5c684c9930779644ff29ca19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sat, 3 Aug 2024 10:38:00 +0200 Subject: [PATCH 31/49] =?UTF-8?q?Python=20u=C5=BE=20je=20d=C3=A1vno=20defa?= =?UTF-8?q?ultn=C4=9B=20utf-8,=20net=C5=99eba=20deklarace=20na=20za=C4=8D?= =?UTF-8?q?=C3=A1tku=20souboru?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- galerie/admin.py | 2 -- galerie/autocomplete_light_registry.py.old | 2 -- galerie/forms.py | 2 -- galerie/migrations/0001_initial.py | 1 - galerie/migrations/0002_auto_20151013_1145.py | 1 - galerie/migrations/0003_add_galerie_poradi.py | 1 - galerie/migrations/0004_nepovinna_galerie_u_obrazku.py | 1 - galerie/migrations/0005_obrazek_ordering_datum.py | 1 - galerie/migrations/0006_django_imagekit.py | 1 - galerie/migrations/0007_obrazek_odstranen_datum.py | 1 - galerie/migrations/0008_auto_20190430_2340.py | 1 - galerie/migrations/0009_auto_20190610_2358.py | 1 - galerie/models.py | 2 -- galerie/views.py | 2 -- korektury/migrations/0001_initial.py | 1 - korektury/migrations/0002_auto_20151202_2351.py | 1 - korektury/migrations/0003_auto_20151204_1855.py | 1 - korektury/migrations/0004_auto_20151204_2240.py | 1 - korektury/migrations/0005_auto_20151204_2244.py | 1 - korektury/migrations/0006_oprava_pdf.py | 1 - korektury/migrations/0007_auto_20151225_1237.py | 1 - korektury/migrations/0008_auto_20151229_1556.py | 1 - korektury/migrations/0009_trizeni_korektur_v_seznamu.py | 1 - korektury/migrations/0010_Pridani_odkazu_na_organizatora.py | 1 - .../migrations/0011_prevod_autora_z_charField_na_Organizator.py | 1 - korektury/migrations/0012_delete_autor.py | 1 - korektury/migrations/0013_rename_autor_org.py | 1 - korektury/migrations/0014_add_org_to_pdf.py | 1 - korektury/migrations/0015_auto_20161004_2005.py | 1 - korektury/migrations/0016_auto_20190430_2340.py | 1 - korektury/migrations/0017_auto_20190610_2358.py | 1 - mamweb/settings_prod.py | 2 -- mamweb/settings_test.py | 2 -- personalni/models.py | 1 - prednasky/admin.py | 1 - prednasky/forms.py | 1 - prednasky/migrations/0001_initial.py | 1 - prednasky/migrations/0002_auto_20160417_2347.py | 1 - prednasky/migrations/0003_auto_20160929_0117.py | 1 - prednasky/migrations/0004_remove_prednaska_seznam.py | 1 - prednasky/migrations/0005_auto_20160929_0153.py | 1 - prednasky/migrations/0006_hlasovani_seznam.py | 1 - prednasky/migrations/0007_prednaska_seznamy.py | 1 - prednasky/migrations/0008_auto_20160929_0225.py | 1 - prednasky/migrations/0009_auto_20160929_0354.py | 1 - prednasky/migrations/0010_auto_20160929_0508.py | 1 - prednasky/migrations/0011_auto_20190430_2340.py | 1 - prednasky/migrations/0012_auto_20190610_2358.py | 1 - prednasky/models.py | 2 -- prednasky/views.py | 1 - requirements.txt | 1 - seminar/management/commands/load_org_permissions.py | 2 -- seminar/management/commands/save_org_permissions.py | 2 -- seminar/management/commands/testdata.py | 2 -- seminar/migrations/0001_initial.py | 1 - seminar/migrations/0002_add_body_views.py | 1 - seminar/migrations/0003_add_skola_zs_ss.py | 1 - seminar/migrations/0004_add_old_dakos_id.py | 1 - seminar/migrations/0005_alter_problem_autor.py | 1 - seminar/migrations/0006_problem_add_timestamp.py | 1 - seminar/migrations/0007_problem_zamereni.py | 1 - seminar/migrations/0008_reseni_forma.py | 1 - seminar/migrations/0009_rename_imported_IDs.py | 1 - seminar/migrations/0010_alter_rok_maturity.py | 1 - seminar/migrations/0011_alter_timestamp_def.py | 1 - seminar/migrations/0012_remove_soustredeni_ucastnici.py | 1 - seminar/migrations/0013_soustredeni_ucastnici_through_model.py | 1 - seminar/migrations/0014_uprava_poznamek.py | 1 - seminar/migrations/0015_soustredeni_text.py | 1 - seminar/migrations/0016_texty_problemu.py | 1 - seminar/migrations/0017_texty_problemu_minor.py | 1 - seminar/migrations/0018_problemnavrh_problemzadany.py | 1 - seminar/migrations/0019_rocnik_ciselne.py | 1 - seminar/migrations/0020_indexy_a_razeni.py | 1 - seminar/migrations/0021_cislo_verejna_vysledkovka.py | 1 - seminar/migrations/0022_decimal_body.py | 1 - seminar/migrations/0023_add_novinky.py | 1 - seminar/migrations/0024_add_organizator.py | 1 - seminar/migrations/0025_zmena_cesty_nahravani_obrazku.py | 1 - seminar/migrations/0026_soustredeni_typ.py | 1 - seminar/migrations/0027_export_flag_a_typ_akce.py | 1 - seminar/migrations/0028_add_body_celkem_views.py | 1 - seminar/migrations/0029_fix_body_celkem_views.py | 1 - seminar/migrations/0030_add_vysledky.py | 1 - seminar/migrations/0031_cislo_pdf.py | 1 - seminar/migrations/0032_cislo_pdf_blank_typos.py | 1 - seminar/migrations/0033_organizator_studuje_popisek.py | 1 - seminar/migrations/0034_reseni_forma_default_email.py | 1 - seminar/migrations/0035_django_imagekit.py | 1 - seminar/migrations/0036_add_org_to_soustredeni.py | 1 - seminar/migrations/0037_prispevek.py | 1 - seminar/migrations/0038_change_meta_prispevek.py | 1 - seminar/migrations/0039_pohadka.py | 1 - seminar/migrations/0040_pohadka_nepovinny_autor.py | 1 - seminar/migrations/0041_konfery.py | 1 - seminar/migrations/0042_auto_20161005_0847.py | 1 - seminar/migrations/0042_cislo_faze.py | 1 - seminar/migrations/0043_uprava_faze.py | 1 - seminar/migrations/0044_uprava_faze.py | 1 - seminar/migrations/0045_cislo_pridani_faze_nahrano.py | 1 - seminar/migrations/0046_merge.py | 1 - seminar/migrations/0047_auto_20170120_2118.py | 1 - seminar/migrations/0048_add_cislo_datum_deadline_soustredeni.py | 1 - seminar/migrations/0049_auto_20190430_2354.py | 1 - seminar/migrations/0050_auto_20190510_2228.py | 1 - seminar/migrations/0051_resitel_to_osoba.py | 1 - seminar/migrations/0052_user_to_organizator.py | 1 - seminar/migrations/0053_organizator_organizuje_od_do.py | 1 - seminar/migrations/0055_smazat_nemigrovane_zastarale_veci.py | 1 - seminar/migrations/0056_vrcholy_pro_rocniky_a_cisla.py | 1 - seminar/migrations/0057_reseni_to_reseni_hodnoceni.py | 1 - seminar/migrations/0058_problem_to_uloha_tema_clanek.py | 1 - seminar/migrations/0059_vytvorit_pohadkanode.py | 1 - seminar/migrations/0060_spoj_stromy.py | 1 - seminar/migrations/0061_kill_frankenstein.py | 1 - seminar/migrations/0062_redukce_modelu_pohadky.py | 1 - seminar/migrations/0063_procisteni_migraci.py | 1 - seminar/migrations/0064_auto_20190610_2358.py | 1 - seminar/models/pomocne.py | 1 - seminar/models/treenode.py | 1 - seminar/models/tvorba.py | 1 - seminar/testutils.py | 2 -- seminar/utils.py | 2 -- soustredeni/models.py | 1 - 124 files changed, 137 deletions(-) diff --git a/galerie/admin.py b/galerie/admin.py index 54b0751e..2b270163 100644 --- a/galerie/admin.py +++ b/galerie/admin.py @@ -1,5 +1,3 @@ -#coding: utf-8 - from galerie.models import Obrazek, Galerie from django.contrib import admin from django.http import HttpResponseRedirect diff --git a/galerie/autocomplete_light_registry.py.old b/galerie/autocomplete_light_registry.py.old index dcedfc1a..8a0c5952 100644 --- a/galerie/autocomplete_light_registry.py.old +++ b/galerie/autocomplete_light_registry.py.old @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - from autocomplete_light import shortcuts as autocomplete_light from .models import Obrazek, Galerie diff --git a/galerie/forms.py b/galerie/forms.py index e6666884..e27b53fb 100644 --- a/galerie/forms.py +++ b/galerie/forms.py @@ -1,5 +1,3 @@ -#coding: utf-8 - from django import forms from seminar.models import Soustredeni diff --git a/galerie/migrations/0001_initial.py b/galerie/migrations/0001_initial.py index 21701185..9e65fe22 100644 --- a/galerie/migrations/0001_initial.py +++ b/galerie/migrations/0001_initial.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/galerie/migrations/0002_auto_20151013_1145.py b/galerie/migrations/0002_auto_20151013_1145.py index ea241267..5ec830a6 100644 --- a/galerie/migrations/0002_auto_20151013_1145.py +++ b/galerie/migrations/0002_auto_20151013_1145.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/galerie/migrations/0003_add_galerie_poradi.py b/galerie/migrations/0003_add_galerie_poradi.py index d9b32f48..a8abf94d 100644 --- a/galerie/migrations/0003_add_galerie_poradi.py +++ b/galerie/migrations/0003_add_galerie_poradi.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/galerie/migrations/0004_nepovinna_galerie_u_obrazku.py b/galerie/migrations/0004_nepovinna_galerie_u_obrazku.py index 53e17922..a2b593b1 100644 --- a/galerie/migrations/0004_nepovinna_galerie_u_obrazku.py +++ b/galerie/migrations/0004_nepovinna_galerie_u_obrazku.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/galerie/migrations/0005_obrazek_ordering_datum.py b/galerie/migrations/0005_obrazek_ordering_datum.py index 988e0fd4..cc6f2948 100644 --- a/galerie/migrations/0005_obrazek_ordering_datum.py +++ b/galerie/migrations/0005_obrazek_ordering_datum.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/galerie/migrations/0006_django_imagekit.py b/galerie/migrations/0006_django_imagekit.py index 6b90b791..b38caae3 100644 --- a/galerie/migrations/0006_django_imagekit.py +++ b/galerie/migrations/0006_django_imagekit.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/galerie/migrations/0007_obrazek_odstranen_datum.py b/galerie/migrations/0007_obrazek_odstranen_datum.py index 94c3596b..9ee8ac46 100644 --- a/galerie/migrations/0007_obrazek_odstranen_datum.py +++ b/galerie/migrations/0007_obrazek_odstranen_datum.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/galerie/migrations/0008_auto_20190430_2340.py b/galerie/migrations/0008_auto_20190430_2340.py index 140d554a..df70a161 100644 --- a/galerie/migrations/0008_auto_20190430_2340.py +++ b/galerie/migrations/0008_auto_20190430_2340.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-04-30 21:40 from __future__ import unicode_literals diff --git a/galerie/migrations/0009_auto_20190610_2358.py b/galerie/migrations/0009_auto_20190610_2358.py index 0228a8a7..513ee1de 100644 --- a/galerie/migrations/0009_auto_20190610_2358.py +++ b/galerie/migrations/0009_auto_20190610_2358.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.21 on 2019-06-10 21:58 from __future__ import unicode_literals diff --git a/galerie/models.py b/galerie/models.py index 96225101..074b0d26 100644 --- a/galerie/models.py +++ b/galerie/models.py @@ -1,5 +1,3 @@ -# coding: utf-8 - from django.db import models #from django.db.models import Q from imagekit.models import ImageSpecField diff --git a/galerie/views.py b/galerie/views.py index f0d9b53b..872bb46e 100644 --- a/galerie/views.py +++ b/galerie/views.py @@ -1,5 +1,3 @@ -# coding: utf-8 - import random from django.http import HttpResponse, Http404 diff --git a/korektury/migrations/0001_initial.py b/korektury/migrations/0001_initial.py index e9a89d18..37c2d18e 100644 --- a/korektury/migrations/0001_initial.py +++ b/korektury/migrations/0001_initial.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/korektury/migrations/0002_auto_20151202_2351.py b/korektury/migrations/0002_auto_20151202_2351.py index 2e7a8032..ed17b81c 100644 --- a/korektury/migrations/0002_auto_20151202_2351.py +++ b/korektury/migrations/0002_auto_20151202_2351.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/korektury/migrations/0003_auto_20151204_1855.py b/korektury/migrations/0003_auto_20151204_1855.py index 8f8cb70b..f08d8ece 100644 --- a/korektury/migrations/0003_auto_20151204_1855.py +++ b/korektury/migrations/0003_auto_20151204_1855.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/korektury/migrations/0004_auto_20151204_2240.py b/korektury/migrations/0004_auto_20151204_2240.py index ed47ccaf..18413ce0 100644 --- a/korektury/migrations/0004_auto_20151204_2240.py +++ b/korektury/migrations/0004_auto_20151204_2240.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/korektury/migrations/0005_auto_20151204_2244.py b/korektury/migrations/0005_auto_20151204_2244.py index 52ebdfb6..7047a49c 100644 --- a/korektury/migrations/0005_auto_20151204_2244.py +++ b/korektury/migrations/0005_auto_20151204_2244.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/korektury/migrations/0006_oprava_pdf.py b/korektury/migrations/0006_oprava_pdf.py index e8f81884..988388b2 100644 --- a/korektury/migrations/0006_oprava_pdf.py +++ b/korektury/migrations/0006_oprava_pdf.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/korektury/migrations/0007_auto_20151225_1237.py b/korektury/migrations/0007_auto_20151225_1237.py index 805e3510..6f6436d5 100644 --- a/korektury/migrations/0007_auto_20151225_1237.py +++ b/korektury/migrations/0007_auto_20151225_1237.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/korektury/migrations/0008_auto_20151229_1556.py b/korektury/migrations/0008_auto_20151229_1556.py index 50e28379..253fe64d 100644 --- a/korektury/migrations/0008_auto_20151229_1556.py +++ b/korektury/migrations/0008_auto_20151229_1556.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/korektury/migrations/0009_trizeni_korektur_v_seznamu.py b/korektury/migrations/0009_trizeni_korektur_v_seznamu.py index c4099dce..8fde3a28 100644 --- a/korektury/migrations/0009_trizeni_korektur_v_seznamu.py +++ b/korektury/migrations/0009_trizeni_korektur_v_seznamu.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/korektury/migrations/0010_Pridani_odkazu_na_organizatora.py b/korektury/migrations/0010_Pridani_odkazu_na_organizatora.py index 6b318cab..445496ee 100644 --- a/korektury/migrations/0010_Pridani_odkazu_na_organizatora.py +++ b/korektury/migrations/0010_Pridani_odkazu_na_organizatora.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/korektury/migrations/0011_prevod_autora_z_charField_na_Organizator.py b/korektury/migrations/0011_prevod_autora_z_charField_na_Organizator.py index 53082df9..30d40ef5 100644 --- a/korektury/migrations/0011_prevod_autora_z_charField_na_Organizator.py +++ b/korektury/migrations/0011_prevod_autora_z_charField_na_Organizator.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/korektury/migrations/0012_delete_autor.py b/korektury/migrations/0012_delete_autor.py index 4f41a955..ad542e18 100644 --- a/korektury/migrations/0012_delete_autor.py +++ b/korektury/migrations/0012_delete_autor.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/korektury/migrations/0013_rename_autor_org.py b/korektury/migrations/0013_rename_autor_org.py index db0d3151..99d1b3f4 100644 --- a/korektury/migrations/0013_rename_autor_org.py +++ b/korektury/migrations/0013_rename_autor_org.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/korektury/migrations/0014_add_org_to_pdf.py b/korektury/migrations/0014_add_org_to_pdf.py index afd939ba..d497ea16 100644 --- a/korektury/migrations/0014_add_org_to_pdf.py +++ b/korektury/migrations/0014_add_org_to_pdf.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/korektury/migrations/0015_auto_20161004_2005.py b/korektury/migrations/0015_auto_20161004_2005.py index 36be10df..d4659ffc 100644 --- a/korektury/migrations/0015_auto_20161004_2005.py +++ b/korektury/migrations/0015_auto_20161004_2005.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/korektury/migrations/0016_auto_20190430_2340.py b/korektury/migrations/0016_auto_20190430_2340.py index f14bce2b..7c264485 100644 --- a/korektury/migrations/0016_auto_20190430_2340.py +++ b/korektury/migrations/0016_auto_20190430_2340.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-04-30 21:40 from __future__ import unicode_literals diff --git a/korektury/migrations/0017_auto_20190610_2358.py b/korektury/migrations/0017_auto_20190610_2358.py index 111f2f8f..a135a020 100644 --- a/korektury/migrations/0017_auto_20190610_2358.py +++ b/korektury/migrations/0017_auto_20190610_2358.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.21 on 2019-06-10 21:58 from __future__ import unicode_literals diff --git a/mamweb/settings_prod.py b/mamweb/settings_prod.py index 060ba870..7d9c99e9 100644 --- a/mamweb/settings_prod.py +++ b/mamweb/settings_prod.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - import os.path # diff --git a/mamweb/settings_test.py b/mamweb/settings_test.py index dc5beee8..83c08b92 100644 --- a/mamweb/settings_test.py +++ b/mamweb/settings_test.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - import os.path # diff --git a/personalni/models.py b/personalni/models.py index d7beb22a..8f6cd63f 100644 --- a/personalni/models.py +++ b/personalni/models.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import logging from django.db import models diff --git a/prednasky/admin.py b/prednasky/admin.py index c9807b27..d086cd0c 100644 --- a/prednasky/admin.py +++ b/prednasky/admin.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from django.contrib import admin from django.contrib import messages from reversion.admin import VersionAdmin diff --git a/prednasky/forms.py b/prednasky/forms.py index 071d068e..f095a64e 100644 --- a/prednasky/forms.py +++ b/prednasky/forms.py @@ -1,4 +1,3 @@ -# coding: utf-8 from django import forms class NewPrednaskyForm(forms.Form): diff --git a/prednasky/migrations/0001_initial.py b/prednasky/migrations/0001_initial.py index 07da4a4e..06db1d7b 100644 --- a/prednasky/migrations/0001_initial.py +++ b/prednasky/migrations/0001_initial.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/prednasky/migrations/0002_auto_20160417_2347.py b/prednasky/migrations/0002_auto_20160417_2347.py index aa09d465..10e5d24c 100644 --- a/prednasky/migrations/0002_auto_20160417_2347.py +++ b/prednasky/migrations/0002_auto_20160417_2347.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/prednasky/migrations/0003_auto_20160929_0117.py b/prednasky/migrations/0003_auto_20160929_0117.py index 606d6cf7..3c6929fa 100644 --- a/prednasky/migrations/0003_auto_20160929_0117.py +++ b/prednasky/migrations/0003_auto_20160929_0117.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/prednasky/migrations/0004_remove_prednaska_seznam.py b/prednasky/migrations/0004_remove_prednaska_seznam.py index d149199f..4eee9c42 100644 --- a/prednasky/migrations/0004_remove_prednaska_seznam.py +++ b/prednasky/migrations/0004_remove_prednaska_seznam.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/prednasky/migrations/0005_auto_20160929_0153.py b/prednasky/migrations/0005_auto_20160929_0153.py index 7ecff0a0..b7aa5814 100644 --- a/prednasky/migrations/0005_auto_20160929_0153.py +++ b/prednasky/migrations/0005_auto_20160929_0153.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/prednasky/migrations/0006_hlasovani_seznam.py b/prednasky/migrations/0006_hlasovani_seznam.py index e1b7bd8f..05f9acc3 100644 --- a/prednasky/migrations/0006_hlasovani_seznam.py +++ b/prednasky/migrations/0006_hlasovani_seznam.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/prednasky/migrations/0007_prednaska_seznamy.py b/prednasky/migrations/0007_prednaska_seznamy.py index 8f054e17..335cceef 100644 --- a/prednasky/migrations/0007_prednaska_seznamy.py +++ b/prednasky/migrations/0007_prednaska_seznamy.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/prednasky/migrations/0008_auto_20160929_0225.py b/prednasky/migrations/0008_auto_20160929_0225.py index a5bbb92e..054ad059 100644 --- a/prednasky/migrations/0008_auto_20160929_0225.py +++ b/prednasky/migrations/0008_auto_20160929_0225.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/prednasky/migrations/0009_auto_20160929_0354.py b/prednasky/migrations/0009_auto_20160929_0354.py index 6b4f9486..5b5bb54f 100644 --- a/prednasky/migrations/0009_auto_20160929_0354.py +++ b/prednasky/migrations/0009_auto_20160929_0354.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/prednasky/migrations/0010_auto_20160929_0508.py b/prednasky/migrations/0010_auto_20160929_0508.py index b654e23f..30a33395 100644 --- a/prednasky/migrations/0010_auto_20160929_0508.py +++ b/prednasky/migrations/0010_auto_20160929_0508.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/prednasky/migrations/0011_auto_20190430_2340.py b/prednasky/migrations/0011_auto_20190430_2340.py index a01d1878..dc081254 100644 --- a/prednasky/migrations/0011_auto_20190430_2340.py +++ b/prednasky/migrations/0011_auto_20190430_2340.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-04-30 21:40 from __future__ import unicode_literals diff --git a/prednasky/migrations/0012_auto_20190610_2358.py b/prednasky/migrations/0012_auto_20190610_2358.py index 1ca6db83..f6551d8a 100644 --- a/prednasky/migrations/0012_auto_20190610_2358.py +++ b/prednasky/migrations/0012_auto_20190610_2358.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.21 on 2019-06-10 21:58 from __future__ import unicode_literals diff --git a/prednasky/models.py b/prednasky/models.py index 54764381..74b37403 100644 --- a/prednasky/models.py +++ b/prednasky/models.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - from django.db import models from soustredeni.models import Soustredeni diff --git a/prednasky/views.py b/prednasky/views.py index 2c370b7a..699b690d 100644 --- a/prednasky/views.py +++ b/prednasky/views.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from django.shortcuts import render, get_object_or_404 from django.views import generic from django.shortcuts import HttpResponseRedirect diff --git a/requirements.txt b/requirements.txt index 4a7163d3..6855e0ae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- -c constraints.txt # basic libs diff --git a/seminar/management/commands/load_org_permissions.py b/seminar/management/commands/load_org_permissions.py index c1e4a106..6b4f9e0a 100644 --- a/seminar/management/commands/load_org_permissions.py +++ b/seminar/management/commands/load_org_permissions.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - from django.core.management.base import BaseCommand from django.contrib.sessions.models import Session from django.contrib.auth.models import Group, Permission diff --git a/seminar/management/commands/save_org_permissions.py b/seminar/management/commands/save_org_permissions.py index a6814e6f..216f9e4b 100644 --- a/seminar/management/commands/save_org_permissions.py +++ b/seminar/management/commands/save_org_permissions.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - from django.core.management.base import BaseCommand from django.contrib.sessions.models import Session from django.contrib.auth.models import Group, Permission diff --git a/seminar/management/commands/testdata.py b/seminar/management/commands/testdata.py index dbbd908d..d9ce8cfb 100644 --- a/seminar/management/commands/testdata.py +++ b/seminar/management/commands/testdata.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - import datetime import os import random diff --git a/seminar/migrations/0001_initial.py b/seminar/migrations/0001_initial.py index 088193b3..cd36a7dc 100644 --- a/seminar/migrations/0001_initial.py +++ b/seminar/migrations/0001_initial.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0002_add_body_views.py b/seminar/migrations/0002_add_body_views.py index 3d128ab9..1ece029e 100644 --- a/seminar/migrations/0002_add_body_views.py +++ b/seminar/migrations/0002_add_body_views.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0003_add_skola_zs_ss.py b/seminar/migrations/0003_add_skola_zs_ss.py index 1b1fbb80..478e49d3 100644 --- a/seminar/migrations/0003_add_skola_zs_ss.py +++ b/seminar/migrations/0003_add_skola_zs_ss.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0004_add_old_dakos_id.py b/seminar/migrations/0004_add_old_dakos_id.py index 1ec28943..769232cb 100644 --- a/seminar/migrations/0004_add_old_dakos_id.py +++ b/seminar/migrations/0004_add_old_dakos_id.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0005_alter_problem_autor.py b/seminar/migrations/0005_alter_problem_autor.py index d8a40585..d7763ecc 100644 --- a/seminar/migrations/0005_alter_problem_autor.py +++ b/seminar/migrations/0005_alter_problem_autor.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0006_problem_add_timestamp.py b/seminar/migrations/0006_problem_add_timestamp.py index fd1509de..dd5fd94c 100644 --- a/seminar/migrations/0006_problem_add_timestamp.py +++ b/seminar/migrations/0006_problem_add_timestamp.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0007_problem_zamereni.py b/seminar/migrations/0007_problem_zamereni.py index 10718bd7..d1363cde 100644 --- a/seminar/migrations/0007_problem_zamereni.py +++ b/seminar/migrations/0007_problem_zamereni.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0008_reseni_forma.py b/seminar/migrations/0008_reseni_forma.py index 399e81a9..22b36d43 100644 --- a/seminar/migrations/0008_reseni_forma.py +++ b/seminar/migrations/0008_reseni_forma.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0009_rename_imported_IDs.py b/seminar/migrations/0009_rename_imported_IDs.py index 997bc0ac..06eaf074 100644 --- a/seminar/migrations/0009_rename_imported_IDs.py +++ b/seminar/migrations/0009_rename_imported_IDs.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0010_alter_rok_maturity.py b/seminar/migrations/0010_alter_rok_maturity.py index 58c099fb..bfae4d5f 100644 --- a/seminar/migrations/0010_alter_rok_maturity.py +++ b/seminar/migrations/0010_alter_rok_maturity.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0011_alter_timestamp_def.py b/seminar/migrations/0011_alter_timestamp_def.py index 238386a6..90582816 100644 --- a/seminar/migrations/0011_alter_timestamp_def.py +++ b/seminar/migrations/0011_alter_timestamp_def.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0012_remove_soustredeni_ucastnici.py b/seminar/migrations/0012_remove_soustredeni_ucastnici.py index ddb61304..2011659c 100644 --- a/seminar/migrations/0012_remove_soustredeni_ucastnici.py +++ b/seminar/migrations/0012_remove_soustredeni_ucastnici.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0013_soustredeni_ucastnici_through_model.py b/seminar/migrations/0013_soustredeni_ucastnici_through_model.py index c725691d..944ae080 100644 --- a/seminar/migrations/0013_soustredeni_ucastnici_through_model.py +++ b/seminar/migrations/0013_soustredeni_ucastnici_through_model.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0014_uprava_poznamek.py b/seminar/migrations/0014_uprava_poznamek.py index 0eb34984..ee52c65b 100644 --- a/seminar/migrations/0014_uprava_poznamek.py +++ b/seminar/migrations/0014_uprava_poznamek.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0015_soustredeni_text.py b/seminar/migrations/0015_soustredeni_text.py index 87298eba..4f9ebd88 100644 --- a/seminar/migrations/0015_soustredeni_text.py +++ b/seminar/migrations/0015_soustredeni_text.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0016_texty_problemu.py b/seminar/migrations/0016_texty_problemu.py index 451c888e..0e91f010 100644 --- a/seminar/migrations/0016_texty_problemu.py +++ b/seminar/migrations/0016_texty_problemu.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0017_texty_problemu_minor.py b/seminar/migrations/0017_texty_problemu_minor.py index f732c111..cd3f2a1c 100644 --- a/seminar/migrations/0017_texty_problemu_minor.py +++ b/seminar/migrations/0017_texty_problemu_minor.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0018_problemnavrh_problemzadany.py b/seminar/migrations/0018_problemnavrh_problemzadany.py index afdcfa8c..42c448f9 100644 --- a/seminar/migrations/0018_problemnavrh_problemzadany.py +++ b/seminar/migrations/0018_problemnavrh_problemzadany.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0019_rocnik_ciselne.py b/seminar/migrations/0019_rocnik_ciselne.py index da9591aa..72055d18 100644 --- a/seminar/migrations/0019_rocnik_ciselne.py +++ b/seminar/migrations/0019_rocnik_ciselne.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0020_indexy_a_razeni.py b/seminar/migrations/0020_indexy_a_razeni.py index 1e199f0e..59674291 100644 --- a/seminar/migrations/0020_indexy_a_razeni.py +++ b/seminar/migrations/0020_indexy_a_razeni.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0021_cislo_verejna_vysledkovka.py b/seminar/migrations/0021_cislo_verejna_vysledkovka.py index d4d34c7f..19768357 100644 --- a/seminar/migrations/0021_cislo_verejna_vysledkovka.py +++ b/seminar/migrations/0021_cislo_verejna_vysledkovka.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0022_decimal_body.py b/seminar/migrations/0022_decimal_body.py index ff92fcde..22acbf99 100644 --- a/seminar/migrations/0022_decimal_body.py +++ b/seminar/migrations/0022_decimal_body.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals import importlib diff --git a/seminar/migrations/0023_add_novinky.py b/seminar/migrations/0023_add_novinky.py index 7db2a005..6e5db0c4 100644 --- a/seminar/migrations/0023_add_novinky.py +++ b/seminar/migrations/0023_add_novinky.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0024_add_organizator.py b/seminar/migrations/0024_add_organizator.py index 16faee72..4ce7a5e3 100644 --- a/seminar/migrations/0024_add_organizator.py +++ b/seminar/migrations/0024_add_organizator.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0025_zmena_cesty_nahravani_obrazku.py b/seminar/migrations/0025_zmena_cesty_nahravani_obrazku.py index 23e02c95..0d1ee7b4 100644 --- a/seminar/migrations/0025_zmena_cesty_nahravani_obrazku.py +++ b/seminar/migrations/0025_zmena_cesty_nahravani_obrazku.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0026_soustredeni_typ.py b/seminar/migrations/0026_soustredeni_typ.py index 46d3416f..3c97c387 100644 --- a/seminar/migrations/0026_soustredeni_typ.py +++ b/seminar/migrations/0026_soustredeni_typ.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0027_export_flag_a_typ_akce.py b/seminar/migrations/0027_export_flag_a_typ_akce.py index e7172dcc..e6616f36 100644 --- a/seminar/migrations/0027_export_flag_a_typ_akce.py +++ b/seminar/migrations/0027_export_flag_a_typ_akce.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0028_add_body_celkem_views.py b/seminar/migrations/0028_add_body_celkem_views.py index 0f6799f0..c26baec2 100644 --- a/seminar/migrations/0028_add_body_celkem_views.py +++ b/seminar/migrations/0028_add_body_celkem_views.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0029_fix_body_celkem_views.py b/seminar/migrations/0029_fix_body_celkem_views.py index 5e287747..b2b9f24a 100644 --- a/seminar/migrations/0029_fix_body_celkem_views.py +++ b/seminar/migrations/0029_fix_body_celkem_views.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0030_add_vysledky.py b/seminar/migrations/0030_add_vysledky.py index 06842c6b..65289e23 100644 --- a/seminar/migrations/0030_add_vysledky.py +++ b/seminar/migrations/0030_add_vysledky.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0031_cislo_pdf.py b/seminar/migrations/0031_cislo_pdf.py index c51570bf..b2b65102 100644 --- a/seminar/migrations/0031_cislo_pdf.py +++ b/seminar/migrations/0031_cislo_pdf.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0032_cislo_pdf_blank_typos.py b/seminar/migrations/0032_cislo_pdf_blank_typos.py index b16c4501..b72ad75d 100644 --- a/seminar/migrations/0032_cislo_pdf_blank_typos.py +++ b/seminar/migrations/0032_cislo_pdf_blank_typos.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0033_organizator_studuje_popisek.py b/seminar/migrations/0033_organizator_studuje_popisek.py index 07f15712..cc9f7e63 100644 --- a/seminar/migrations/0033_organizator_studuje_popisek.py +++ b/seminar/migrations/0033_organizator_studuje_popisek.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0034_reseni_forma_default_email.py b/seminar/migrations/0034_reseni_forma_default_email.py index 2d691b30..6cbe180c 100644 --- a/seminar/migrations/0034_reseni_forma_default_email.py +++ b/seminar/migrations/0034_reseni_forma_default_email.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0035_django_imagekit.py b/seminar/migrations/0035_django_imagekit.py index dd443018..ba18c7cc 100644 --- a/seminar/migrations/0035_django_imagekit.py +++ b/seminar/migrations/0035_django_imagekit.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0036_add_org_to_soustredeni.py b/seminar/migrations/0036_add_org_to_soustredeni.py index 4db43239..357cdf7b 100644 --- a/seminar/migrations/0036_add_org_to_soustredeni.py +++ b/seminar/migrations/0036_add_org_to_soustredeni.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations diff --git a/seminar/migrations/0037_prispevek.py b/seminar/migrations/0037_prispevek.py index c4c3b867..cb32f983 100644 --- a/seminar/migrations/0037_prispevek.py +++ b/seminar/migrations/0037_prispevek.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/seminar/migrations/0038_change_meta_prispevek.py b/seminar/migrations/0038_change_meta_prispevek.py index 5378e57e..80a2bef5 100644 --- a/seminar/migrations/0038_change_meta_prispevek.py +++ b/seminar/migrations/0038_change_meta_prispevek.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/seminar/migrations/0039_pohadka.py b/seminar/migrations/0039_pohadka.py index f798bd75..4636accc 100644 --- a/seminar/migrations/0039_pohadka.py +++ b/seminar/migrations/0039_pohadka.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/seminar/migrations/0040_pohadka_nepovinny_autor.py b/seminar/migrations/0040_pohadka_nepovinny_autor.py index babf9b24..5be7ac80 100644 --- a/seminar/migrations/0040_pohadka_nepovinny_autor.py +++ b/seminar/migrations/0040_pohadka_nepovinny_autor.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/seminar/migrations/0041_konfery.py b/seminar/migrations/0041_konfery.py index 9fddbe17..bb040465 100644 --- a/seminar/migrations/0041_konfery.py +++ b/seminar/migrations/0041_konfery.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/seminar/migrations/0042_auto_20161005_0847.py b/seminar/migrations/0042_auto_20161005_0847.py index 27930952..e606e325 100644 --- a/seminar/migrations/0042_auto_20161005_0847.py +++ b/seminar/migrations/0042_auto_20161005_0847.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/seminar/migrations/0042_cislo_faze.py b/seminar/migrations/0042_cislo_faze.py index 7d35ace5..0685e932 100644 --- a/seminar/migrations/0042_cislo_faze.py +++ b/seminar/migrations/0042_cislo_faze.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/seminar/migrations/0043_uprava_faze.py b/seminar/migrations/0043_uprava_faze.py index 29e06e01..aff30bc3 100644 --- a/seminar/migrations/0043_uprava_faze.py +++ b/seminar/migrations/0043_uprava_faze.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/seminar/migrations/0044_uprava_faze.py b/seminar/migrations/0044_uprava_faze.py index 0d683d6c..e05d56a8 100644 --- a/seminar/migrations/0044_uprava_faze.py +++ b/seminar/migrations/0044_uprava_faze.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/seminar/migrations/0045_cislo_pridani_faze_nahrano.py b/seminar/migrations/0045_cislo_pridani_faze_nahrano.py index 06ca8201..a48db840 100644 --- a/seminar/migrations/0045_cislo_pridani_faze_nahrano.py +++ b/seminar/migrations/0045_cislo_pridani_faze_nahrano.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/seminar/migrations/0046_merge.py b/seminar/migrations/0046_merge.py index 19352440..46496f5c 100644 --- a/seminar/migrations/0046_merge.py +++ b/seminar/migrations/0046_merge.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/seminar/migrations/0047_auto_20170120_2118.py b/seminar/migrations/0047_auto_20170120_2118.py index 1876fe25..4486d786 100644 --- a/seminar/migrations/0047_auto_20170120_2118.py +++ b/seminar/migrations/0047_auto_20170120_2118.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/seminar/migrations/0048_add_cislo_datum_deadline_soustredeni.py b/seminar/migrations/0048_add_cislo_datum_deadline_soustredeni.py index 134a00a8..71df4284 100644 --- a/seminar/migrations/0048_add_cislo_datum_deadline_soustredeni.py +++ b/seminar/migrations/0048_add_cislo_datum_deadline_soustredeni.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models diff --git a/seminar/migrations/0049_auto_20190430_2354.py b/seminar/migrations/0049_auto_20190430_2354.py index 14fa23d8..3fb7c437 100644 --- a/seminar/migrations/0049_auto_20190430_2354.py +++ b/seminar/migrations/0049_auto_20190430_2354.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-04-30 21:54 from __future__ import unicode_literals diff --git a/seminar/migrations/0050_auto_20190510_2228.py b/seminar/migrations/0050_auto_20190510_2228.py index a9afc764..86f2639b 100644 --- a/seminar/migrations/0050_auto_20190510_2228.py +++ b/seminar/migrations/0050_auto_20190510_2228.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-10 20:28 from __future__ import unicode_literals diff --git a/seminar/migrations/0051_resitel_to_osoba.py b/seminar/migrations/0051_resitel_to_osoba.py index 6644ab7d..81eab2d5 100644 --- a/seminar/migrations/0051_resitel_to_osoba.py +++ b/seminar/migrations/0051_resitel_to_osoba.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-10 20:44 from __future__ import unicode_literals diff --git a/seminar/migrations/0052_user_to_organizator.py b/seminar/migrations/0052_user_to_organizator.py index a91a7966..0577a0e0 100644 --- a/seminar/migrations/0052_user_to_organizator.py +++ b/seminar/migrations/0052_user_to_organizator.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2019-05-16 20:59 from __future__ import unicode_literals diff --git a/seminar/migrations/0053_organizator_organizuje_od_do.py b/seminar/migrations/0053_organizator_organizuje_od_do.py index b94e8032..b46b93de 100644 --- a/seminar/migrations/0053_organizator_organizuje_od_do.py +++ b/seminar/migrations/0053_organizator_organizuje_od_do.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-16 21:26 from __future__ import unicode_literals diff --git a/seminar/migrations/0055_smazat_nemigrovane_zastarale_veci.py b/seminar/migrations/0055_smazat_nemigrovane_zastarale_veci.py index 1b6f95f4..66eae38c 100644 --- a/seminar/migrations/0055_smazat_nemigrovane_zastarale_veci.py +++ b/seminar/migrations/0055_smazat_nemigrovane_zastarale_veci.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-23 20:16 from __future__ import unicode_literals diff --git a/seminar/migrations/0056_vrcholy_pro_rocniky_a_cisla.py b/seminar/migrations/0056_vrcholy_pro_rocniky_a_cisla.py index 56146261..4c755c48 100644 --- a/seminar/migrations/0056_vrcholy_pro_rocniky_a_cisla.py +++ b/seminar/migrations/0056_vrcholy_pro_rocniky_a_cisla.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-23 21:54 from __future__ import unicode_literals diff --git a/seminar/migrations/0057_reseni_to_reseni_hodnoceni.py b/seminar/migrations/0057_reseni_to_reseni_hodnoceni.py index a11d99ae..9e162b94 100644 --- a/seminar/migrations/0057_reseni_to_reseni_hodnoceni.py +++ b/seminar/migrations/0057_reseni_to_reseni_hodnoceni.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-28 21:46 from __future__ import unicode_literals diff --git a/seminar/migrations/0058_problem_to_uloha_tema_clanek.py b/seminar/migrations/0058_problem_to_uloha_tema_clanek.py index 4ef135c4..f8fbc87b 100644 --- a/seminar/migrations/0058_problem_to_uloha_tema_clanek.py +++ b/seminar/migrations/0058_problem_to_uloha_tema_clanek.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-17 17:44 from __future__ import unicode_literals diff --git a/seminar/migrations/0059_vytvorit_pohadkanode.py b/seminar/migrations/0059_vytvorit_pohadkanode.py index 2a78c7ee..8aca874b 100644 --- a/seminar/migrations/0059_vytvorit_pohadkanode.py +++ b/seminar/migrations/0059_vytvorit_pohadkanode.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-29 03:26 from __future__ import unicode_literals diff --git a/seminar/migrations/0060_spoj_stromy.py b/seminar/migrations/0060_spoj_stromy.py index d0826ca1..6bf74f28 100644 --- a/seminar/migrations/0060_spoj_stromy.py +++ b/seminar/migrations/0060_spoj_stromy.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-29 03:26 from __future__ import unicode_literals diff --git a/seminar/migrations/0061_kill_frankenstein.py b/seminar/migrations/0061_kill_frankenstein.py index 0a367edf..80cde7a1 100644 --- a/seminar/migrations/0061_kill_frankenstein.py +++ b/seminar/migrations/0061_kill_frankenstein.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-29 03:29 from __future__ import unicode_literals diff --git a/seminar/migrations/0062_redukce_modelu_pohadky.py b/seminar/migrations/0062_redukce_modelu_pohadky.py index b4e5f11e..80bf280e 100644 --- a/seminar/migrations/0062_redukce_modelu_pohadky.py +++ b/seminar/migrations/0062_redukce_modelu_pohadky.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-30 01:16 from __future__ import unicode_literals diff --git a/seminar/migrations/0063_procisteni_migraci.py b/seminar/migrations/0063_procisteni_migraci.py index 3dce57ad..52f84179 100644 --- a/seminar/migrations/0063_procisteni_migraci.py +++ b/seminar/migrations/0063_procisteni_migraci.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-30 01:32 from __future__ import unicode_literals diff --git a/seminar/migrations/0064_auto_20190610_2358.py b/seminar/migrations/0064_auto_20190610_2358.py index 78e62862..8f1a90f4 100644 --- a/seminar/migrations/0064_auto_20190610_2358.py +++ b/seminar/migrations/0064_auto_20190610_2358.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.21 on 2019-06-10 21:58 from __future__ import unicode_literals diff --git a/seminar/models/pomocne.py b/seminar/models/pomocne.py index cb552a67..9fc6b7cd 100644 --- a/seminar/models/pomocne.py +++ b/seminar/models/pomocne.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import logging import os from django.db import models diff --git a/seminar/models/treenode.py b/seminar/models/treenode.py index 735501c0..abc20eab 100644 --- a/seminar/models/treenode.py +++ b/seminar/models/treenode.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import logging from django.db import models diff --git a/seminar/models/tvorba.py b/seminar/models/tvorba.py index 4ef57bde..209008f5 100644 --- a/seminar/models/tvorba.py +++ b/seminar/models/tvorba.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import datetime import os import subprocess diff --git a/seminar/testutils.py b/seminar/testutils.py index 0d90456a..be7f3677 100644 --- a/seminar/testutils.py +++ b/seminar/testutils.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - import datetime from django.contrib.auth.models import Permission diff --git a/seminar/utils.py b/seminar/utils.py index 7c009210..c826bf0b 100644 --- a/seminar/utils.py +++ b/seminar/utils.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - import datetime import decimal diff --git a/soustredeni/models.py b/soustredeni/models.py index 78582565..518b3291 100644 --- a/soustredeni/models.py +++ b/soustredeni/models.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import logging import os From 75344c2c3a23e499517f39d769db0ed4aca57858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sat, 3 Aug 2024 10:39:31 +0200 Subject: [PATCH 32/49] Kontroly codestylu nechceme --- _git_hooks/README.md | 16 ------------ _git_hooks/pre-commit | 30 --------------------- _git_hooks/update | 61 ------------------------------------------- 3 files changed, 107 deletions(-) delete mode 100644 _git_hooks/README.md delete mode 100755 _git_hooks/pre-commit delete mode 100755 _git_hooks/update diff --git a/_git_hooks/README.md b/_git_hooks/README.md deleted file mode 100644 index e74e5c53..00000000 --- a/_git_hooks/README.md +++ /dev/null @@ -1,16 +0,0 @@ -git hooks -========= - -Kontrola stylu pythoních zdrojáků pomocí flake8. Kontrolujeme jen změny, -abychom nenutili lidi dělat nesouvisející úpravy, které by rozbíjely historii -(git blame). - -pre-commit ----------- -* kontrola změn před commitnutím -* instalace: lokálně zkopírovat do .git/hooks (musí být spustitelný) - -update ------- -* kontrola změn přicházejících s pushem -* instalace: na atreyi zkopírovat do /akce/MaM/MaMweb/mamweb.git/hooks diff --git a/_git_hooks/pre-commit b/_git_hooks/pre-commit deleted file mode 100755 index f78840d4..00000000 --- a/_git_hooks/pre-commit +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# -# Git hook script to verify what is about to be committed. -# Checks that the changes don't introduce new flake8 errors. - -TMPDIFF=`tempfile` -FLAKE8="`git rev-parse --show-toplevel`/bin/flake8" - -status=0 - -# select only changed python files which are not migrations -changed=`git diff --cached --name-only | grep 'py$' | grep -v 'migrations/[0-9]'` -if [ -z $changed ] ; then - # Nothing to check. Note the exit is necessary -- we would not pass any - # paths to git diff below and it would output the diff unfiltered. - exit 0 -fi - -git diff --unified=1 --cached HEAD -- $changed > $TMPDIFF - -# only do the check when there are some changes to be commited -# otherwise flake8 would hang waiting for input -if [ -s $TMPDIFF ] ; then - cat $TMPDIFF | $FLAKE8 --diff - status=$? -fi - -rm -f $TMPDIFF - -exit $status diff --git a/_git_hooks/update b/_git_hooks/update deleted file mode 100755 index c700a1b1..00000000 --- a/_git_hooks/update +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -# git update hook to check that pushed changes don't introduce new flake8 -# errors - -# --- Command line -refname="$1" -oldrev="$2" -newrev="$3" - -# --- Safety check -if [ -z "$GIT_DIR" ]; then - echo "Don't run this script from the command line." >&2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - - -TMPDIR=`mktemp -d` -TMPDIFF=`tempfile` - -[ $refname != "refs/heads/master" -a $refname != "refs/heads/stable" ] && exit 0 - -# select only changed python files which are not migrations -changed=`git diff --name-only $oldrev $newrev | grep 'py$' | grep -v 'migrations/[0-9]'` -if [ -z $changed ] ; then - # Nothing to check. Note the exit is necessary -- we would not pass any - # paths to git diff below and it would output the diff unfiltered. - exit 0 -fi - -git diff --unified=1 $oldrev $newrev -- $changed >${TMPDIFF} - -# there is no working tree in bare git repository, so we recreate it for flake8 -git archive $newrev | tar -x -C ${TMPDIR} - -cd ${TMPDIR} -# report only errors on lines in diff -# (if threre was flake8 installed on atrey, we could just call flake8) -/akce/MaM/WWW/mamweb-test/bin/flake8 --diff <${TMPDIFF} -status=$? -if [ $status != 0 ] ; then - echo - echo -n "Změny, které se snažíte pushnout, obsahují kód v pythonu " - echo -n "nevyhovující flake8 (viz výše). Opravte je a zkuste to znovu. " - echo -n "Nezapomeňte, že můžete editovat historii (git commit --amend, " - echo -n "git rebase -i). Pokud byste chybu příště raději odhalili už při " - echo "commitu, zkopírujte si pre-commit hook z _git_hooks do .git/hooks." - echo -fi - -rm -rf ${TMPDIR} -rm -f ${TMPDIFF} - -exit $status From 7a6a7cb0f58b640b9448f6c4e352f8cd4ccaf830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sat, 3 Aug 2024 10:42:31 +0200 Subject: [PATCH 33/49] =?UTF-8?q?N=C3=A1vod=20na=20nahr=C3=A1t=C3=AD=20obr?= =?UTF-8?q?=C3=A1zk=C5=AF=20do=20odm=C4=9Bn=20(a=20jinak=20o=20flatpage)?= =?UTF-8?q?=20nem=C3=A1=20smysl=20m=C3=ADt=20v=20ko=C5=99enov=C3=A9=20slo?= =?UTF-8?q?=C5=BEce?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {ilustrace_odmeny => docs}/jak_nahrat_do_flatpage | 1 + 1 file changed, 1 insertion(+) rename {ilustrace_odmeny => docs}/jak_nahrat_do_flatpage (82%) diff --git a/ilustrace_odmeny/jak_nahrat_do_flatpage b/docs/jak_nahrat_do_flatpage similarity index 82% rename from ilustrace_odmeny/jak_nahrat_do_flatpage rename to docs/jak_nahrat_do_flatpage index 7e88641d..2c4b208c 100644 --- a/ilustrace_odmeny/jak_nahrat_do_flatpage +++ b/docs/jak_nahrat_do_flatpage @@ -1,3 +1,4 @@ +FIXME přepsat do rst, přidat i další věci a případně přesunout na wiki Přidání obrázků do odměn: admin -> flatpage odměn -> ikona přidat obrázek záložka odeslat, vybrat obrázek, odeslat From 081701213087ccd945cf1828b6e17be7fdcebdaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sat, 3 Aug 2024 10:55:03 +0200 Subject: [PATCH 34/49] =?UTF-8?q?Tahle=20moje=20=E2=80=9Edokumentace?= =?UTF-8?q?=E2=80=9C=20je=20k=20ni=C4=8Demu,=20ma=C5=BEu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aesop/apps.py | 3 --- aesop/urls.py | 7 ------- aesop/views.py | 5 ----- api/apps.py | 3 --- api/urls.py | 12 ------------ api/views/__init__.py | 5 ----- galerie/urls.py | 9 --------- header_fotky/admin.py | 13 +------------ header_fotky/apps.py | 3 --- header_fotky/models.py | 14 -------------- korektury/admin.py | 10 ---------- korektury/forms.py | 10 ---------- korektury/models.py | 14 -------------- korektury/urls.py | 8 -------- korektury/views.py | 5 ----- mamweb/urls.py | 15 +-------------- odevzdavatko/admin.py | 6 ------ odevzdavatko/apps.py | 3 --- odevzdavatko/urls.py | 14 -------------- personalni/apps.py | 3 --- personalni/urls.py | 14 -------------- prednasky/urls.py | 9 --------- seminar/urls.py | 31 ------------------------------- soustredeni/apps.py | 3 --- treenode/apps.py | 3 --- treenode/urls.py | 5 ----- various/apps.py | 3 --- various/autentizace/forms.py | 11 ----------- various/autentizace/urls.py | 13 ------------- vysledkovky/apps.py | 3 --- 30 files changed, 2 insertions(+), 255 deletions(-) diff --git a/aesop/apps.py b/aesop/apps.py index d7dea2e3..3974f084 100644 --- a/aesop/apps.py +++ b/aesop/apps.py @@ -1,6 +1,3 @@ -""" -Soubor sloužící k pojmenování a jiným nastavením djangovské aplikace. -""" from django.apps import AppConfig class AesopConfig(AppConfig): diff --git a/aesop/urls.py b/aesop/urls.py index 946a873b..f39a0ba8 100644 --- a/aesop/urls.py +++ b/aesop/urls.py @@ -1,10 +1,3 @@ -""" -Soubor sloužící jako „router“, tj. zde se definují url adresy a na co ukazují: - -- ``aesop-export/mam-rocnik-.csv`` (seminar_export_rocnik) :class:`~aesop.views.ExportRocnikView` -- ``aesop-export/mam-sous-.csv`` (seminar_export_sous) :class:`~aesop.views.ExportSousView` -- ``aesop-export/index.csv`` (seminar_export_index) :class:`~aesop.views.ExportIndexView` -""" from django.urls import path from aesop import views diff --git a/aesop/views.py b/aesop/views.py index e4b3364b..5fd49cbc 100644 --- a/aesop/views.py +++ b/aesop/views.py @@ -1,8 +1,3 @@ -""" -Soubor sloužící k deklaraci jednotlivých „views“ (nejčastěji funkce beroucí request -a vracející :func:`django.shortcuts.render` respektive nějakou response, nebo -třídy většinou rozšiřující nějakou třídu z :mod:`django.views.generic`) -""" import django from django.shortcuts import get_object_or_404 from django.http import HttpResponse diff --git a/api/apps.py b/api/apps.py index a74c8c0e..3800f6a9 100644 --- a/api/apps.py +++ b/api/apps.py @@ -1,6 +1,3 @@ -""" -Soubor sloužící k pojmenování a jiným nastavením djangovské aplikace. -""" from django.apps import AppConfig diff --git a/api/urls.py b/api/urls.py index a3b5a4aa..9ff38424 100644 --- a/api/urls.py +++ b/api/urls.py @@ -1,15 +1,3 @@ -""" -Soubor sloužící jako „router“, tj. zde se definují url adresy a na co ukazují: - -- ``api/expor/skoly/`` (export_skoly) :func:`~api.views.exports.exportSkolView` -- ``api/autocomplete/skola/`` (autocomplete_skola) :class:`~api.views.autocomplete.SkolaAutocomplete` -- ``api/autocomplete/resitel/`` (autocomplete_resitel) :class:`~api.views.autocomplete.ResitelAutocomplete` -- ``api/autocomplete/problem/odevzdatelny`` (autocomplete_problem_odevzdatelny) :class:`~api.views.autocomplete.OdevzdatelnyProblemAutocomplete` - -Na autocomplete v3 čeká: - -- ``autocomplete/organizatori/`` (seminar_autocomplete_organizator) :class:`~api.views.autocomplete.OrganizatorAutocomplete` -""" from django.urls import path from . import views from seminar.utils import org_required diff --git a/api/views/__init__.py b/api/views/__init__.py index 13ce91ba..fc00554e 100644 --- a/api/views/__init__.py +++ b/api/views/__init__.py @@ -1,7 +1,2 @@ -""" -Soubory sloužící k deklaraci jednotlivých „views“ (nejčastěji funkce beroucí request -a vracející :func:`django.shortcuts.render` respektive nějakou response, nebo -třídy většinou rozšiřující nějakou třídu z :mod:`django.views.generic`) -""" from .autocomplete import * from .exports import * diff --git a/galerie/urls.py b/galerie/urls.py index 2e311cd8..32824248 100644 --- a/galerie/urls.py +++ b/galerie/urls.py @@ -1,12 +1,3 @@ -""" -Soubor sloužící jako „router“, tj. zde se definují url adresy a na co ukazují: - -- ``/`` :func:`~galerie.views.nahled` -- ``//`` :func:`~galerie.views.detail` -- ``/new/`` :func:`~galerie.views.new_galerie` -- ``/plus//`` :func:`~galerie.views.plus_galerie` -- ``/minus//`` :func:`~galerie.views.minus_galerie` -""" from django.urls import path from seminar.utils import org_required from . import views diff --git a/header_fotky/admin.py b/header_fotky/admin.py index b939541b..cfcb4d48 100644 --- a/header_fotky/admin.py +++ b/header_fotky/admin.py @@ -1,14 +1,3 @@ -""" -Soubor sloužící k definici toho, co bude v adminu. Většinou pouhým zavoláním -funkce :func:`django.contrib.admin.site.register`, v případě, že chceme něco -upravit, tak jako třída rozšiřující :class:`django.contrib.admin.ModelAdmin` -s dekorátorem :func:`django.contrib.admin.register`. - -Zde se definuje admin pro: - -- :class:`~header_fotky.models.FotkaHeader` -- :class:`~header_fotky.models.FotkaUrlVazba` -""" from django.contrib import admin from django.contrib.admin import ModelAdmin import header_fotky.models as m @@ -22,4 +11,4 @@ class FotkaPozadiAdmin(ModelAdmin): readonly_fields = ['cas'] admin.site.register(m.FotkaHeader, FotkaPozadiAdmin) -admin.site.register(m.FotkaUrlVazba) \ No newline at end of file +admin.site.register(m.FotkaUrlVazba) diff --git a/header_fotky/apps.py b/header_fotky/apps.py index 9cf572ec..6f9e5aee 100644 --- a/header_fotky/apps.py +++ b/header_fotky/apps.py @@ -1,6 +1,3 @@ -""" -Soubor sloužící k pojmenování a jiným nastavením djangovské aplikace. -""" from django.apps import AppConfig diff --git a/header_fotky/models.py b/header_fotky/models.py index 750cc575..e48a743a 100644 --- a/header_fotky/models.py +++ b/header_fotky/models.py @@ -1,17 +1,3 @@ -""" -Tento soubor slouží k definici databázového modelu. - -Třídy rozšiřují většinou :class:`django.db.models.Model` a jejich atributy jsou -většinou sloupce v databázi (tj. nastaví se na hodnotu něčeho z :mod:`django.db.models`). -Na výběr jsou: - - - :class:`django.db.models.TextField` - - :class:`django.db.models.ForeignKey` - - :class:`django.db.models.DateField` - - :class:`django.db.models.DateTimeField` - - :class:`django.db.models.ImageField` - - :class:`django.db.models.CharField` -""" from django.core.exceptions import ValidationError from django.db import models from django.utils import timezone diff --git a/korektury/admin.py b/korektury/admin.py index 5f92c542..881a951c 100644 --- a/korektury/admin.py +++ b/korektury/admin.py @@ -1,13 +1,3 @@ -""" -Soubor sloužící k definici toho, co bude v adminu. Většinou pouhým zavoláním -funkce :func:`django.contrib.admin.site.register`, v případě, že chceme něco -upravit, tak jako třída rozšiřující :class:`django.contrib.admin.ModelAdmin` -s dekorátorem :func:`django.contrib.admin.register`. - -Zde se definuje admin pro: - -- :class:`korektury.models.KorekturovanePDF` -""" from django.contrib import admin from reversion.admin import VersionAdmin from korektury.models import KorekturovanePDF diff --git a/korektury/forms.py b/korektury/forms.py index 2fd439a6..22c82818 100644 --- a/korektury/forms.py +++ b/korektury/forms.py @@ -1,13 +1,3 @@ -""" -Formuláře (:class:`django.forms.Form`) umožňují jednoduchou tvorbu formulářů, -které lze pak jednoduše dát do frontendu i zpracovat na backendu. - -Pro přidání políčka do formuláře je potřeba - - mít v modelu tu položku, kterou chci upravovat - - přidat do views (prihlaskaView, resitelEditView) - - přidat do forms - - includovat do html -""" from django import forms class OpravaForm(forms.Form): diff --git a/korektury/models.py b/korektury/models.py index ca1bb877..153c4f3c 100644 --- a/korektury/models.py +++ b/korektury/models.py @@ -1,17 +1,3 @@ -""" -Tento soubor slouží k definici databázového modelu. - -Třídy rozšiřují většinou :class:`django.db.models.Model` a jejich atributy jsou -většinou sloupce v databázi (tj. nastaví se na hodnotu něčeho z :mod:`django.db.models`). -Na výběr jsou: - - - :class:`django.db.models.TextField` - - :class:`django.db.models.ForeignKey` - - :class:`django.db.models.DateField` - - :class:`django.db.models.DateTimeField` - - :class:`django.db.models.ImageField` - - :class:`django.db.models.CharField` -""" import os from django.db import models from django.utils import timezone diff --git a/korektury/urls.py b/korektury/urls.py index 96eb4dd4..dcd1d965 100644 --- a/korektury/urls.py +++ b/korektury/urls.py @@ -1,11 +1,3 @@ -""" -Soubor sloužící jako „router“, tj. zde se definují url adresy a na co ukazují: - -- ``korektury/`` (korektury_list) :class:`~korektury.views.KorekturySeskupeneListView` -- ``korektury/neseskupene/`` (korektury_neseskupene_list) :class:`~korektury.views.KorekturyAktualniListView` -- ``korektury/zastarale/`` (korektury_stare_list) :class:`~korektury.views.KorekturyZastaraleListView` -- ``korektury//`` (korektury) :class:`~korektury.views.KorekturyView` -""" from django.urls import path from seminar.utils import org_required from . import views diff --git a/korektury/views.py b/korektury/views.py index 1bdfaa92..d5066af8 100644 --- a/korektury/views.py +++ b/korektury/views.py @@ -1,8 +1,3 @@ -""" -Soubor sloužící k deklaraci jednotlivých „views“ (nejčastěji funkce beroucí request -a vracející :func:`django.shortcuts.render` respektive nějakou response, nebo -třídy většinou rozšiřující nějakou třídu z :mod:`django.views.generic`) -""" from django.shortcuts import get_object_or_404, render from django.views import generic from django.conf import settings diff --git a/mamweb/urls.py b/mamweb/urls.py index cdd7df09..4b870fec 100644 --- a/mamweb/urls.py +++ b/mamweb/urls.py @@ -1,18 +1,5 @@ """ -Soubor sloužící jako základní „router“, tj. zde se includují veškeré ostatní urls: - -- ``admin/`` :mod:`django.contrib.admin.site.urls` -- ``ckeditor/`` :mod:`ckeditor_uploader.urls` -- :mod:`seminar.urls` -- :mod:`odevzdavatko.urls` -- :mod:`korektury.urls` -- :mod:`prednasky.urls` -- :mod:`soustredeni.urls` -- :mod:`personalni.urls` -- :mod:`various.autentizace.urls` -- :mod:`api.urls` -- :mod:`treenode.urls` -- :mod:`aesop.urls` +Soubor sloužící jako základní „router“, tj. zde se includují veškeré ostatní urls. """ from django.urls import path, include from django.contrib.staticfiles.urls import staticfiles_urlpatterns diff --git a/odevzdavatko/admin.py b/odevzdavatko/admin.py index 168beab1..6048eb36 100644 --- a/odevzdavatko/admin.py +++ b/odevzdavatko/admin.py @@ -1,9 +1,3 @@ -""" -Soubor sloužící k definici toho, co bude v adminu. Většinou pouhým zavoláním -funkce :func:`django.contrib.admin.site.register`, v případě, že chceme něco -upravit, tak jako třída rozšiřující :class:`django.contrib.admin.ModelAdmin` -s dekorátorem :func:`django.contrib.admin.register`. -""" from django.contrib import admin from django_reverse_admin import ReverseModelAdmin import seminar.models as m diff --git a/odevzdavatko/apps.py b/odevzdavatko/apps.py index d20e4a5a..98c02c0b 100644 --- a/odevzdavatko/apps.py +++ b/odevzdavatko/apps.py @@ -1,6 +1,3 @@ -""" -Soubor sloužící k pojmenování a jiným nastavením djangovské aplikace. -""" from django.apps import AppConfig diff --git a/odevzdavatko/urls.py b/odevzdavatko/urls.py index 6b021f2e..e41b9c14 100644 --- a/odevzdavatko/urls.py +++ b/odevzdavatko/urls.py @@ -1,17 +1,3 @@ -""" -Soubor sloužící jako „router“, tj. zde se definují url adresy a na co ukazují: - -- ``org/add_solution`` (seminar_vloz_reseni) :class:`~odevzdavatko.views.PosliReseniView` -- ``resitel/nahraj_reseni`` (seminar_nahraj_reseni) :class:`~odevzdavatko.views.NahrajReseniView` -- ``resitel/odevzdana_reseni/`` (seminar_resitel_odevzdana_reseni) :class:`~odevzdavatko.views.PrehledOdevzdanychReseni` -- ``org/reseni/`` (odevzdavatko_tabulka) :class:`~odevzdavatko.views.TabulkaOdevzdanychReseniView` -- ``org/reseni/rocnik//`` (odevzdavatko_tabulka) :class:`~odevzdavatko.views.TabulkaOdevzdanychReseniView` -- ``org/reseni///`` (odevzdavatko_reseni_resitele_k_problemu) :class:`~odevzdavatko.views.ReseniProblemuView` -- ``org/reseni//`` (odevzdavatko_detail_reseni) :func:`~seminar.utils.viewMethodSwitch` + :class:`~odevzdavatko.views.DetailReseniView` + :func:`~odevzdavatko.views.hodnoceniReseniView` -- ``org/reseni/all`` :class:`~odevzdavatko.views.SeznamReseniView` -- ``org/reseni/akt`` :class:`~odevzdavatko.views.TabulkaOdevzdanychReseniView` -- ``resitel/reseni/`` (odevzdavatko_resitel_reseni) :class:`~odevzdavatko.views.ResitelReseniView` -""" from django.urls import path from seminar.utils import org_required, resitel_required, viewMethodSwitch, \ diff --git a/personalni/apps.py b/personalni/apps.py index a6ea47fa..8312e3ec 100644 --- a/personalni/apps.py +++ b/personalni/apps.py @@ -1,6 +1,3 @@ -""" -Soubor sloužící k pojmenování a jiným nastavením djangovské aplikace. -""" from django.apps import AppConfig diff --git a/personalni/urls.py b/personalni/urls.py index cbcdb035..73a6f720 100644 --- a/personalni/urls.py +++ b/personalni/urls.py @@ -1,17 +1,3 @@ -""" -Soubor sloužící jako „router“, tj. zde se definují url adresy a na co ukazují: - -- ``org/add_solution`` (seminar_vloz_reseni) :class:`~odevzdavatko.views.PosliReseniView` -- ``resitel/nahraj_reseni`` (seminar_nahraj_reseni) :class:`~odevzdavatko.views.NahrajReseniView` -- ``resitel/odevzdana_reseni/`` (seminar_resitel_odevzdana_reseni) :class:`~odevzdavatko.views.PrehledOdevzdanychReseni` -- ``org/reseni/`` (odevzdavatko_tabulka) :class:`~odevzdavatko.views.TabulkaOdevzdanychReseniView` -- ``org/reseni/rocnik//`` (odevzdavatko_tabulka) :class:`~odevzdavatko.views.TabulkaOdevzdanychReseniView` -- ``org/reseni///`` (odevzdavatko_reseni_resitele_k_problemu) :class:`~odevzdavatko.views.ReseniProblemuView` -- ``org/reseni//`` (odevzdavatko_detail_reseni) :func:`~seminar.utils.viewMethodSwitch` + :class:`~odevzdavatko.views.DetailReseniView` + :func:`~odevzdavatko.views.hodnoceniReseniView` -- ``org/reseni/all`` :class:`~odevzdavatko.views.SeznamReseniView` -- ``org/reseni/akt`` :class:`~odevzdavatko.views.TabulkaOdevzdanychReseniView` -- ``resitel/reseni/`` (odevzdavatko_resitel_reseni) :class:`~odevzdavatko.views.ResitelReseniView` -""" from django.urls import path from django.contrib.auth.decorators import login_required from . import views diff --git a/prednasky/urls.py b/prednasky/urls.py index d0e7a703..6b455163 100644 --- a/prednasky/urls.py +++ b/prednasky/urls.py @@ -1,12 +1,3 @@ -""" -Soubor sloužící jako „router“, tj. zde se definují url adresy a na co ukazují: - -- ``prednasky/`` :func:`~prednasky.views.newPrednaska` -- ``prednasky/hotovo`` :func:`~prednasky.views.Prednaska_hotovo` -- ``prednasky/metaseznam_prednasek`` (metaseznam-list) :class:`~prednasky.views.MetaSeznamListView` -- ``prednasky/seznam_prednasek//export`` (seznam-export) :func:`~prednasky.views.SeznamExportView` -- ``prednasky/seznam_prednasek//`` (seznam-list) :class:`~prednasky.views.SeznamListView` -""" from django.urls import path from seminar.utils import org_required, resitel_or_org_required from . import views diff --git a/seminar/urls.py b/seminar/urls.py index f6f2e2fb..f740e6a4 100644 --- a/seminar/urls.py +++ b/seminar/urls.py @@ -1,34 +1,3 @@ -""" -Soubor sloužící jako „router“, tj. zde se definují url adresy a na co ukazují: - -- Organizátoři - - ``o-nas/organizatori/`` (organizatori) :class:`~seminar.views.views_all.CojemamOrganizatoriView` - - ``o-nas/organizatori/organizovali/`` (stari_organizatori) :class:`~seminar.views.views_all.CojemamOrganizatoriStariView` -- Archiv - - ``archiv/rocniky/`` (seminar_archiv_rocniky) :class:`~seminar.views.views_all.ArchivView` - - ``archiv/temata/`` (seminar_archiv_temata) :class:`~seminar.views.views_all.ArchivTemataView` - - ``rocnik//`` (seminar_rocnik) :class:`~seminar.views.views_all.RocnikView` - - ``cislo/./`` (seminar_cislo) :class:`~seminar.views.views_all.CisloView` - - ``problem//`` (seminar_problem) :func:`~seminar.views.views_all.problemView` -- Zadání - - ``aktualni/zadani/`` (seminar_aktualni_zadani) :func:`~seminar.views.views_all.AktualniZadaniView` - - ``aktualni/vysledkova-listina/`` (seminar_aktualni_vysledky) :func:`~seminar.views.views_all.ZadaniAktualniVysledkovkaView` - - ``aktualni/rocnik/`` (seminar_aktualni_rocnik) :class:`~seminar.views.views_all.AktualniRocnikRedirectView` -- Články - - ``archiv/clanky/`` (clanky_resitel) :class:`~seminar.views.views_all.ClankyResitelView` -- Orgovské stránky - - ``rocnik//vysledkovka.tex`` (seminar_rocnik_vysledkovka) :class:`~seminar.views.views_all.RocnikVysledkovkaView` - - ``rocnik//resitele.csv`` (seminar_rocnik_resitele_csv) :func:`~seminar.views.views_all.resiteleRocnikuCsvExportView` - - ``cislo/./vysledkovka.tex`` (seminar_cislo_vysledkovka) :class:`~seminar.views.views_all.CisloVysledkovkaView` - - ``cislo/./obalky.pdf`` (seminar_cislo_obalky) :func:`~seminar.views.views_all.cisloObalkyView` - - ``cislo/./tituly.tex`` (seminar_cislo_titul) :func:`~seminar.views.views_all.TitulyView` - - ``stav`` (stav_databaze) :func:`~seminar.views.views_all.StavDatabazeView` - - ``cislo/./odmeny/./`` (seminar_archiv_odmeny) :class:`~seminar.views.views_all.OdmenyView` -- Další - - `` `` (titulni_strana) :class:`~seminar.views.views_all.TitulniStranaView` - - ``jak-resit/`` (jak_resit) :class:`~seminar.views.views_all.JakResitView` - - ``stare-novinky/`` (stare_novinky) :class:`~seminar.views.views_all.StareNovinkyView` -""" from django.urls import path, include, re_path from . import views from .utils import org_required diff --git a/soustredeni/apps.py b/soustredeni/apps.py index 3dd0b94e..90e25f5b 100644 --- a/soustredeni/apps.py +++ b/soustredeni/apps.py @@ -1,6 +1,3 @@ -""" -Soubor sloužící k pojmenování a jiným nastavením djangovské aplikace. -""" from django.apps import AppConfig diff --git a/treenode/apps.py b/treenode/apps.py index 7e709e48..5a04a618 100644 --- a/treenode/apps.py +++ b/treenode/apps.py @@ -1,6 +1,3 @@ -""" -Soubor sloužící k pojmenování a jiným nastavením djangovské aplikace. -""" from django.apps import AppConfig diff --git a/treenode/urls.py b/treenode/urls.py index 1b6444bb..60dc88ad 100644 --- a/treenode/urls.py +++ b/treenode/urls.py @@ -1,8 +1,3 @@ -""" -Soubor sloužící jako „router“, tj. zde se definují url adresy a na co ukazují: - -- Zatím tu nic moc není… -""" from django.urls import path, re_path from . import views diff --git a/various/apps.py b/various/apps.py index d1f6ad2e..751fe3a6 100644 --- a/various/apps.py +++ b/various/apps.py @@ -1,6 +1,3 @@ -""" -Soubor sloužící k pojmenování a jiným nastavením djangovské aplikace. -""" from django.apps import AppConfig diff --git a/various/autentizace/forms.py b/various/autentizace/forms.py index f3138d74..bf1ab597 100644 --- a/various/autentizace/forms.py +++ b/various/autentizace/forms.py @@ -1,14 +1,3 @@ -""" -Formuláře (:class:`django.forms.Form`) umožňují jednoduchou tvorbu formulářů, -které lze pak jednoduše dát do frontendu i zpracovat na backendu. - -Pro přidání políčka do formuláře je potřeba - - mít v modelu tu položku, kterou chci upravovat - - přidat do views (prihlaskaView, resitelEditView) - - přidat do forms - - includovat do html -""" - from django.contrib.auth.forms import AuthenticationForm from django.forms import BooleanField diff --git a/various/autentizace/urls.py b/various/autentizace/urls.py index a89ff89e..83c8e50e 100644 --- a/various/autentizace/urls.py +++ b/various/autentizace/urls.py @@ -1,16 +1,3 @@ -""" -Soubor sloužící jako „router“, tj. zde se definují url adresy a na co ukazují: - -- ``prihlasit/`` (login) :class:`~various.autentizace.views.LoginView` -- ``login/`` :class:`django.views.generic.base.RedirectView` předchozího -- ``odhlasit/`` (logout) :class:`~various.autentizace.views.LogoutView` -- ``logout/`` :class:`django.views.generic.base.RedirectView` předchozího -- ``reset-hesla/`` (reset_password) :class:`~various.autentizace.views.PasswordResetView` -- ``zmena-hesla/`` (change_password) :class:`~various.autentizace.views.PasswordChangeView` -- ``zmena-hesla/2/`` (reset_password_done) :class:`~various.autentizace.views.PasswordResetDoneView` -- ``reset-hesla/potvrzeni///`` (reset_password_confirm) :class:`~various.autentizace.views.PasswordResetConfirmView` -- ``reset-hesla/hotovo/`` (reset_password_complete) :class:`~various.autentizace.views.PasswordResetCompleteView` -""" from django.urls import path from . import views from django.views.generic.base import RedirectView diff --git a/vysledkovky/apps.py b/vysledkovky/apps.py index 7b9a1e0f..ef946395 100644 --- a/vysledkovky/apps.py +++ b/vysledkovky/apps.py @@ -1,6 +1,3 @@ -""" -Soubor sloužící k pojmenování a jiným nastavením djangovské aplikace. -""" from django.apps import AppConfig From 5f9bda9afe0d1487182113fa554268c718c42949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sat, 3 Aug 2024 10:56:51 +0200 Subject: [PATCH 35/49] =?UTF-8?q?Ha,=20tohle=20m=C4=9Blo=20smaz=C3=A1no=20?= =?UTF-8?q?b=C3=BDt=20u=C5=BE=20v=2075344c2c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/dalsi_soubory.rst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/dalsi_soubory.rst b/docs/dalsi_soubory.rst index 627a59d7..2b1a362b 100644 --- a/docs/dalsi_soubory.rst +++ b/docs/dalsi_soubory.rst @@ -9,12 +9,6 @@ static ------ Složka, kam django nakopíruje všechno ze složek static a pak na to z templatů / kódu jde ukazovat pomocí ``static``. -_git_hooks ----------- -Hooky do gitu pro kontrolu Pythoního stylu. Především ``flake8``. - -Zbylo tu z minulosti mamwebu. - data ---- Obsahuje data, která patří do databáze, ale jsou přímo součástí webu jako From ead2a4ede352e9d09e935b8f607278f2ef8cb146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sat, 3 Aug 2024 11:04:19 +0200 Subject: [PATCH 36/49] =?UTF-8?q?Tahle=20middleware=20se=20v=C5=AFbec=20ne?= =?UTF-8?q?pou=C5=BE=C3=ADv=C3=A1=20(pou=C5=BE=C3=ADv=C3=A1=20se=20context?= =?UTF-8?q?processor=20vzhled)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mamweb/middleware.py | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/mamweb/middleware.py b/mamweb/middleware.py index 7109423e..208c6cbd 100644 --- a/mamweb/middleware.py +++ b/mamweb/middleware.py @@ -52,37 +52,3 @@ class LoggedInHintCookieMiddleware(object): if self.cookie_name in request.COOKIES: response.delete_cookie(self.cookie_name) return response - - -class vzhled: - - def process_request(self, request): - return None - - def process_view(self, request, view_func, view_args, view_kwargs): - #print "====== process_request ======" - #print view_func - #print view_args - #print view_kwargs - #print "=============================" - return None - - def process_template_response(self, request, response): - hodin = datetime.now().hour - if (hodin <= 6) or (hodin >= 14): # TODO 20 - response.context_data['noc'] = True - else: - response.context_data['noc'] = False - return response - - def process_response(self, request, response): - #hodin = datetime.now().hour - #if (hodin <= 6) or (hodin >= 14): # TODO 20 - #response.context_data['noc'] = True - #else: - #response.context_data['noc'] = False - return response - - - ##def process_exception(request, exception): - #pass From e21a93f9e7bd063bd465dca98afa598dc86fd9e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sat, 3 Aug 2024 11:06:00 +0200 Subject: [PATCH 37/49] =?UTF-8?q?Middleware=20=C5=99e=C5=A1=C3=ADc=C3=AD?= =?UTF-8?q?=20sessioh=20mezi=20http=20a=20https=20se=20u=C5=BE=20fakt=20dl?= =?UTF-8?q?ouho=20nepou=C5=BE=C3=ADv=C3=A1=20a=20nav=C3=ADc=20je=20toto=20?= =?UTF-8?q?t=C3=A9ma=20dnes=20d=C3=A1vno=20pas=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mamweb/middleware.py | 54 --------------------------------------- mamweb/settings_common.py | 3 --- 2 files changed, 57 deletions(-) delete mode 100644 mamweb/middleware.py diff --git a/mamweb/middleware.py b/mamweb/middleware.py deleted file mode 100644 index 208c6cbd..00000000 --- a/mamweb/middleware.py +++ /dev/null @@ -1,54 +0,0 @@ -from datetime import datetime, date - -from django.conf import settings -from django.http import HttpResponse, HttpResponseRedirect - - - -class LoggedInHintCookieMiddleware(object): - """Middleware to securely help with 'logged-in' detection for dual HTTP/HTTPS sites. - - On insecure requests: Checks for a (non-secure) cookie settings.LOGGED_IN_HINT_COOKIE_NAME - and if present, redirects to HTTPS (same adress). - Note this usually breaks non-GET (POST) requests. - - On secure requests: Updates cookie settings.LOGGED_IN_HINT_COOKIE_NAME to reflect - whether an user is logged in in the current session (cookie set to 'True' or cleared). - The cookie is set to expire at the same time as the sessionid cookie. - - By default, LOGGED_IN_HINT_COOKIE_NAME = 'logged_in_hint'. - """ - - def __init__(self): - if hasattr(settings, 'LOGGED_IN_HINT_COOKIE_NAME'): - self.cookie_name = settings.LOGGED_IN_HINT_COOKIE_NAME - else: self.cookie_name = 'logged_in_hint' - self.cookie_value = 'True' - - def cookie_correct(self, request): - return self.cookie_name in request.COOKIES and request.COOKIES[self.cookie_name] == self.cookie_value - - def process_request(self, request): - if not request.is_secure(): - if self.cookie_correct(request): - # redirect insecure (assuming http) requests with hint cookie to https - url = request.build_absolute_uri() - assert url[:5] == 'http:' - return HttpResponseRedirect('https:' + url[5:]) - return None - - def process_response(self, request, response): - if request.is_secure(): - # assuming full session info (as the conn. is secure) - try: - user = request.user - except AttributeError: # no user - ajax or other special request - return response - if user.is_authenticated(): - if not self.cookie_correct(request): - expiry = None if request.session.get_expire_at_browser_close() else request.session.get_expiry_date() - response.set_cookie(self.cookie_name, value=self.cookie_value, expires=expiry, secure=False) - else: - if self.cookie_name in request.COOKIES: - response.delete_cookie(self.cookie_name) - return response diff --git a/mamweb/settings_common.py b/mamweb/settings_common.py index 92124364..4bc713c8 100644 --- a/mamweb/settings_common.py +++ b/mamweb/settings_common.py @@ -68,9 +68,6 @@ MIDDLEWARE = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', -# FIXME: rozbilo se při přechodu na Django 2.0, nevím, jestli -# se to dá zahodit bez náhrady -# 'mamweb.middleware.LoggedInHintCookieMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', From 1d36cd076127413952a3c77f1c7debec40fbb1a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sat, 3 Aug 2024 11:09:39 +0200 Subject: [PATCH 38/49] =?UTF-8?q?Tohle=20nastaven=C3=AD=20u=C5=BE=20je=20v?= =?UTF-8?q?=20settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- novinky/apps.py | 1 - seminar/apps.py | 1 - 2 files changed, 2 deletions(-) diff --git a/novinky/apps.py b/novinky/apps.py index 92519305..6aa7efe9 100644 --- a/novinky/apps.py +++ b/novinky/apps.py @@ -1,6 +1,5 @@ from django.apps import AppConfig class NovinkyConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' name = 'novinky' verbose_name = 'Novinky' diff --git a/seminar/apps.py b/seminar/apps.py index 161a73f8..ce66f627 100644 --- a/seminar/apps.py +++ b/seminar/apps.py @@ -1,7 +1,6 @@ from django.apps import AppConfig class SeminarConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' name = 'seminar' verbose_name = 'Seminář' From 8fef21900c9d721152732068fb8d937c9a6c35be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sat, 3 Aug 2024 11:28:03 +0200 Subject: [PATCH 39/49] =?UTF-8?q?Autogenerovan=C3=A9=20koment=C3=A1=C5=99e?= =?UTF-8?q?=20a=20pr=C3=A1zdn=C3=A9=20testy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- korektury/admin.py | 1 - korektury/tests.py | 3 --- novinky/tests.py | 3 --- novinky/views.py | 3 --- prednasky/tests.py | 3 --- sifrovacka/admin.py | 2 -- sifrovacka/models.py | 3 --- sifrovacka/views.py | 2 -- various/admin.py | 2 -- various/views.py | 2 -- vyroci/admin.py | 2 -- vyroci/models.py | 2 -- vyroci/views.py | 2 -- 13 files changed, 30 deletions(-) delete mode 100644 korektury/tests.py delete mode 100644 novinky/tests.py delete mode 100644 prednasky/tests.py diff --git a/korektury/admin.py b/korektury/admin.py index 881a951c..a04026de 100644 --- a/korektury/admin.py +++ b/korektury/admin.py @@ -5,7 +5,6 @@ from korektury.models import KorekturovanePDF from django.core.mail import EmailMessage from django.urls import reverse -# Register your models here. class KorekturovanePDFAdmin(VersionAdmin): """ nastaví čas vložení (:attr:`~koretkury.models.KorekturovanePDF.cas`) a počet diff --git a/korektury/tests.py b/korektury/tests.py deleted file mode 100644 index 7ce503c2..00000000 --- a/korektury/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/novinky/tests.py b/novinky/tests.py deleted file mode 100644 index 7ce503c2..00000000 --- a/novinky/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/novinky/views.py b/novinky/views.py index 91ea44a2..e69de29b 100644 --- a/novinky/views.py +++ b/novinky/views.py @@ -1,3 +0,0 @@ -from django.shortcuts import render - -# Create your views here. diff --git a/prednasky/tests.py b/prednasky/tests.py deleted file mode 100644 index 7ce503c2..00000000 --- a/prednasky/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/sifrovacka/admin.py b/sifrovacka/admin.py index 5099c241..ff980cd9 100644 --- a/sifrovacka/admin.py +++ b/sifrovacka/admin.py @@ -2,8 +2,6 @@ from django.contrib import admin from .models import OdpovedUcastnika, SpravnaOdpoved, NapovezenoUcastnikovi, Napoveda -# Register your models here. - admin.site.register(OdpovedUcastnika) admin.site.register(SpravnaOdpoved) admin.site.register(Napoveda) diff --git a/sifrovacka/models.py b/sifrovacka/models.py index 49565252..cd71fd15 100644 --- a/sifrovacka/models.py +++ b/sifrovacka/models.py @@ -4,9 +4,6 @@ from django.utils import timezone from personalni.models import Resitel -# Create your models here. - - class OdpovedUcastnika(models.Model): class Meta: ordering = ["-timestamp"] diff --git a/sifrovacka/views.py b/sifrovacka/views.py index 2ad352da..0bfa994f 100644 --- a/sifrovacka/views.py +++ b/sifrovacka/views.py @@ -7,8 +7,6 @@ from .models import OdpovedUcastnika, SpravnaOdpoved, Napoveda, NapovezenoUcastn from personalni.models import Resitel -# Create your views here. - class SifrovackaView(FormView): template_name = 'sifrovacka/sifrovacka.html' form_class = SifrovackaForm diff --git a/various/admin.py b/various/admin.py index 8c38f3f3..694323fa 100644 --- a/various/admin.py +++ b/various/admin.py @@ -1,3 +1 @@ from django.contrib import admin - -# Register your models here. diff --git a/various/views.py b/various/views.py index 96d9a29d..e344ff26 100644 --- a/various/views.py +++ b/various/views.py @@ -1,8 +1,6 @@ from django.http import HttpResponseForbidden from django.shortcuts import render -# Create your views here. - def csrf_error(request, reason=""): """ Jednoduchý „template view“ (třída to být nemůže) pro CSRF chyby """ diff --git a/vyroci/admin.py b/vyroci/admin.py index 7bf94bef..61476d24 100644 --- a/vyroci/admin.py +++ b/vyroci/admin.py @@ -2,6 +2,4 @@ from django.contrib import admin from .models import UcastnikVyroci -# Register your models here. - admin.site.register(UcastnikVyroci) diff --git a/vyroci/models.py b/vyroci/models.py index 04fd2097..28e0206a 100644 --- a/vyroci/models.py +++ b/vyroci/models.py @@ -1,7 +1,5 @@ from django.db import models -# Create your models here. - class UcastnikVyroci(models.Model): diff --git a/vyroci/views.py b/vyroci/views.py index a2f4767d..207ed619 100644 --- a/vyroci/views.py +++ b/vyroci/views.py @@ -6,8 +6,6 @@ from .forms import UcastnikVyrociForm from .models import UcastnikVyroci -# Create your views here. - class VyrociView(FormView): template_name = 'vyroci/vyroci.html' form_class = UcastnikVyrociForm From 8dc3a2ba98ca138bcda04c5216368db9b6b5bd16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sat, 3 Aug 2024 11:50:14 +0200 Subject: [PATCH 40/49] =?UTF-8?q?Odstran=C4=9B=C5=88o=20star=C3=A9=20testo?= =?UTF-8?q?v=C3=A1n=C3=AD=20e-mail=C5=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- korektury/views.py | 7 ------- mamweb/settings_common.py | 4 ---- mamweb/settings_prod.py | 1 - mamweb/settings_test.py | 1 - seminar/models/tvorba.py | 3 --- 5 files changed, 16 deletions(-) diff --git a/korektury/views.py b/korektury/views.py index d5066af8..ee6f2841 100644 --- a/korektury/views.py +++ b/korektury/views.py @@ -194,13 +194,6 @@ class KorekturyView(generic.TemplateView): if email: emails.discard(email) - if not settings.POSLI_MAILOVOU_NOTIFIKACI: - print("Poslal bych upozornění na tyto adresy: ", " ".join(emails)) - print("---- Upozornění:") - print(text) - print("---- Konec upozornění") - return - EmailMessage( subject=subject, body=text, diff --git a/mamweb/settings_common.py b/mamweb/settings_common.py index 4bc713c8..f737be1e 100644 --- a/mamweb/settings_common.py +++ b/mamweb/settings_common.py @@ -342,10 +342,6 @@ KOREKTURY_IMG_DIR = os.path.join('korektury', 'img') CISLO_IMG_DIR = os.path.join('cislo', 'img') -# E-MAIL NOTIFICATIONS -POSLI_MAILOVOU_NOTIFIKACI = False - - # Logování chyb class InvalidTemplateVariable(str): diff --git a/mamweb/settings_prod.py b/mamweb/settings_prod.py index 7d9c99e9..4a3f2198 100644 --- a/mamweb/settings_prod.py +++ b/mamweb/settings_prod.py @@ -68,5 +68,4 @@ LOGGING['handlers']['registration_error_log']['filename'] = '/home/mam-web/logs/ # E-MAIL NOTIFICATIONS -POSLI_MAILOVOU_NOTIFIKACI = True LOCAL_TEST_PROD = "prod" diff --git a/mamweb/settings_test.py b/mamweb/settings_test.py index 83c08b92..71f166ed 100644 --- a/mamweb/settings_test.py +++ b/mamweb/settings_test.py @@ -72,7 +72,6 @@ LOGGING['handlers']['registration_error_log']['filename'] = '/home/mam-web/logs/ FILE_UPLOAD_PERMISSIONS = 0o440 # Testování e-mailů -POSLI_MAILOVOU_NOTIFIKACI = True EMAIL_BACKEND = 'various.mail_prefixer.PrefixingMailBackend' # TODO Pouze na otestování testu… Zvolit konferu! # XXX: Je to pole, protože implementační detail backendu. diff --git a/seminar/models/tvorba.py b/seminar/models/tvorba.py index 209008f5..36157c96 100644 --- a/seminar/models/tvorba.py +++ b/seminar/models/tvorba.py @@ -284,9 +284,6 @@ class Cislo(SeminarModelBase): def posli(subject, text, resitele): emaily = map(lambda resitel: resitel.osoba.email, resitele) - if not settings.POSLI_MAILOVOU_NOTIFIKACI: - print("Poslal bych upozornění na tyto adresy: ", " ".join(emaily)) - return email = EmailMessage( subject=subject, From f0b642ca4421bf0b87394f4fbbad7761f82e3d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sat, 3 Aug 2024 12:58:38 +0200 Subject: [PATCH 41/49] =?UTF-8?q?Nepou=C5=BE=C3=ADvan=C3=BD=20kus=20k?= =?UTF-8?q?=C3=B3du?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/admin.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/seminar/admin.py b/seminar/admin.py index deaba97f..f8768ddf 100644 --- a/seminar/admin.py +++ b/seminar/admin.py @@ -178,11 +178,6 @@ class TextAdminInline(admin.TabularInline): admin.site.register(m.Text) -class ResitelInline(admin.TabularInline): - model = m.Resitel - extra = 1 - - # admin.site.register(m.Pohadka) admin.site.register(m.Obrazek) admin.site.register(m.Nastaveni, SingletonModelAdmin) From 69635b42348e24b328b138d6f5ce08d1caa278bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sat, 3 Aug 2024 13:01:10 +0200 Subject: [PATCH 42/49] TODO jsou v kanboardu --- galerie/TODO | 25 ------------------------- korektury/TODO | 11 ----------- 2 files changed, 36 deletions(-) delete mode 100644 galerie/TODO delete mode 100644 korektury/TODO diff --git a/galerie/TODO b/galerie/TODO deleted file mode 100644 index c8afd3c4..00000000 --- a/galerie/TODO +++ /dev/null @@ -1,25 +0,0 @@ -======== -| TODO | -|======| - -Aktualni -* co s titulni fotkou -* do CSS - * nahledy - * nastylovat tabulku s nahledy - * komentare uz na nahledy? - * detail - * nahledy pred a po - * opravit prechodove sipky - * vyrobit prechodove sipky ve M&M-stylu - -Dlouhodobe -* sipky na prechazeni mezi fotkami -* hromadne PRIDANI fotek do jiz existujici galerie - -Fylozoficke -* zvolit velikosti velke a male fotky -* je potreba i jine razeni nez automaticky podle casu nebo staci podgalerie? - * napr. dve hry na dvou ruznych mistech ve stejny cas - * fotky od ucastniku ze hry (skupinky se pohybuji ve stejny cas, ale maji sled fotek) -- nestaci to pripadne vrazit do podgalerii? - diff --git a/korektury/TODO b/korektury/TODO deleted file mode 100644 index df1b937a..00000000 --- a/korektury/TODO +++ /dev/null @@ -1,11 +0,0 @@ -- korektura potrebuje reakci -+ komentáře fixně na username - - používat skutečné jméno? -- vyžádat pozornost autora obsahu -- zvednout upload limit na 5MB -- sbalit a rozbalit korekturu -- nahrávání jiných věcí než PDF - kontrolovat? -- stylování -- seznam PDF - co zobrazovat? - - From 431978e6267d86e2743dbeb7d31d54aa04fd0b0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sat, 3 Aug 2024 13:03:09 +0200 Subject: [PATCH 43/49] =?UTF-8?q?Star=C3=BD=20kus=20k=C3=B3du,=20kter?= =?UTF-8?q?=C3=BD=20by=20se=20mohl=20hodit,=20ale=20je=20p=C5=99=C3=AD?= =?UTF-8?q?=C5=A1ern=C4=9B=20zastaral=C3=BD=20(ObrazekAutocomplete)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- galerie/autocomplete_light_registry.py.old | 45 ---------------------- 1 file changed, 45 deletions(-) delete mode 100644 galerie/autocomplete_light_registry.py.old diff --git a/galerie/autocomplete_light_registry.py.old b/galerie/autocomplete_light_registry.py.old deleted file mode 100644 index 8a0c5952..00000000 --- a/galerie/autocomplete_light_registry.py.old +++ /dev/null @@ -1,45 +0,0 @@ -from autocomplete_light import shortcuts as autocomplete_light - -from .models import Obrazek, Galerie -from .views import cesta_od_korene - - -class ObrazekAutocomplete(autocomplete_light.AutocompleteModelBase): - - model = Obrazek - search_fields = ['nazev', 'popis'] - split_words = True - limit_choices = 15 - attrs = { - # This will set the input placeholder attribute: - 'placeholder': u'Obrázek', - # This will set the yourlabs.Autocomplete.minimumCharacters - # options, the naming conversion is handled by jQuery - 'data-autocomplete-minimum-characters': 1, - } - - choice_html_format = ''' - - - {} - {} - - - ''' - - def choice_label(self, obrazek): - cesta = "/".join(g.nazev for g in cesta_od_korene(obrazek.galerie)) - popis = "{}
    ".format(obrazek.popis) if obrazek.popis else "" - return '{}
    {}{}'.format(obrazek.nazev, popis, cesta) - - def choice_html(self, obrazek): - """Vrátí kus html i s obrázkem, které se pak ukazuje v nabídce""" - return self.choice_html_format.format(self.choice_value(obrazek), - obrazek.obrazek_maly_tag(), self.choice_label(obrazek)) - - widget_attrs={ - 'data-widget-maximum-values': 15, - 'class': 'modern-style', - } - -autocomplete_light.register(ObrazekAutocomplete) From e250f1d5dc0e3b771acfb12d6571dcdd35e90c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Wed, 2 Oct 2024 21:16:53 +0200 Subject: [PATCH 44/49] =?UTF-8?q?Admin=5Furl=20soust=C5=99ed=C4=9Bn=C3=AD?= =?UTF-8?q?=20(aby=20mohlo=20b=C3=BDt=20v=20login-baru)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- soustredeni/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/soustredeni/models.py b/soustredeni/models.py index 518b3291..f71e6736 100644 --- a/soustredeni/models.py +++ b/soustredeni/models.py @@ -77,6 +77,10 @@ class Soustredeni(SeminarModelBase): #return reverse('seminar_soustredeni', kwargs={'pk': self.id}) return reverse('seminar_seznam_soustredeni') + def admin_url(self): + model_name = self.__class__.__name__.lower() + return reverse('admin:soustredeni_{}_change'.format(model_name), args=(self.id, )) + @reversion.register(ignore_duplicates=True) class Soustredeni_Ucastnici(SeminarModelBase): From 733484b503a3c0f0a704586988f4e7e64d219f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Wed, 2 Oct 2024 21:20:44 +0200 Subject: [PATCH 45/49] =?UTF-8?q?Export=20do=20abstrakt=C5=AF=20(soust?= =?UTF-8?q?=C5=99ed=C4=9Bn=C3=AD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/sitetree.json | 24 +++++++++++++++++++ .../soustredeni/export_do_abstraktu.html | 17 +++++++++++++ .../soustredeni/seznam_soustredeni.html | 1 + soustredeni/urls.py | 5 ++++ soustredeni/views.py | 4 ++++ 5 files changed, 51 insertions(+) create mode 100644 soustredeni/templates/soustredeni/export_do_abstraktu.html diff --git a/data/sitetree.json b/data/sitetree.json index 29403e5a..933c628a 100644 --- a/data/sitetree.json +++ b/data/sitetree.json @@ -1079,5 +1079,29 @@ }, "model": "sitetree.treeitem", "pk": 53 + }, + { + "fields": { + "access_guest": false, + "access_loggedin": false, + "access_perm_type": 1, + "access_permissions": [], + "access_restricted": true, + "alias": null, + "description": "", + "hidden": false, + "hint": "", + "inbreadcrumbs": true, + "inmenu": true, + "insitetree": true, + "parent": 20, + "sort_order": 54, + "title": "Export do abstraktů sousu {{ soustredeni.id }}", + "tree": 1, + "url": "seminar_soustredeni_abstrakty soustredeni.id", + "urlaspattern": true + }, + "model": "sitetree.treeitem", + "pk": 54 } ] diff --git a/soustredeni/templates/soustredeni/export_do_abstraktu.html b/soustredeni/templates/soustredeni/export_do_abstraktu.html new file mode 100644 index 00000000..16de19a0 --- /dev/null +++ b/soustredeni/templates/soustredeni/export_do_abstraktu.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} +{% load tex %} + +{% block nadpis1a %} + Soustředění – export do abstraktů +{% endblock %} + +{% block content %} +

    Export do abstraktů Soustředění {{ soustredeni }}

    + +{# Zde zcela záměrně chybí nějaké whitespacy, např. odřádkování a odsazení #} +
    {% for ucastnik in soustredeni.ucastnici.all %}\ucastnik{{ ucastnik|sloz }}{{ ucastnik.osoba.email|sloz }}{{ ucastnik.skola|sloz }}
    +{% endfor %}
    +{% for vedouci in soustredeni.organizatori.all %}\vedouci{{ vedouci|sloz }}{{ vedouci.osoba.email|sloz }}{TODO}
    +{% endfor %}
    + +{% endblock %} diff --git a/soustredeni/templates/soustredeni/seznam_soustredeni.html b/soustredeni/templates/soustredeni/seznam_soustredeni.html index e5f68bfc..ac33852a 100644 --- a/soustredeni/templates/soustredeni/seznam_soustredeni.html +++ b/soustredeni/templates/soustredeni/seznam_soustredeni.html @@ -40,6 +40,7 @@
    Vytvořit novou fotogalerii
    Vygenerovat obálky pro účastníky
    + Vygenerovat účastníky a vedoucí do abstraktů
    Seznam účastníků - HTML tabulka pro tisk, CSV, diff --git a/soustredeni/urls.py b/soustredeni/urls.py index 2e5a6136..6d8de5e1 100644 --- a/soustredeni/urls.py +++ b/soustredeni/urls.py @@ -33,6 +33,11 @@ urlpatterns = [ org_required(views.soustredeniObalkyView), name='seminar_soustredeni_obalky' ), + path( + 'soustredeni//abstrakty', + org_required(views.SoustredeniAbstraktyView.as_view()), + name='seminar_soustredeni_abstrakty' + ), path( 'soustredeni//fotogalerie/', include('galerie.urls') diff --git a/soustredeni/views.py b/soustredeni/views.py index f150b6b8..c7e17d24 100644 --- a/soustredeni/views.py +++ b/soustredeni/views.py @@ -99,3 +99,7 @@ def soustredeniStvrzenkyView(request, soustredeni): with open(tempdir / "stvrzenky.pdf", "rb") as pdffile: response = HttpResponse(pdffile.read(), content_type='application/pdf') return response + +class SoustredeniAbstraktyView(generic.DetailView): + model = Soustredeni + template_name = 'soustredeni/export_do_abstraktu.html' From 6ec2a10bf587b3be1f2510c543cd760aeebb8e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Thu, 10 Oct 2024 13:23:51 +0200 Subject: [PATCH 46/49] setuptools v requirements.txt --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 6855e0ae..8f172e2a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ -c constraints.txt -# basic libs +setuptools # django-polymorphic má rozbité dependencies +# basic libs psycopg2 # PostgreSQL adaptér ipython # Interaktivní shell Unidecode # Přepisuje unicode do ASCII (např. soubory nebo e-maily) From e87bbe60480a205cba4c616280b6ba6073aa9907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sun, 13 Oct 2024 23:31:05 +0200 Subject: [PATCH 47/49] =?UTF-8?q?Sloupe=C4=8Dek=20ostatn=C3=AD=20ve=20v?= =?UTF-8?q?=C3=BDsledkovce=20(nov=C3=A1=20makra)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/templates/seminar/archiv/cislo_vysledkovka.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seminar/templates/seminar/archiv/cislo_vysledkovka.tex b/seminar/templates/seminar/archiv/cislo_vysledkovka.tex index bebd5632..b8e9f248 100644 --- a/seminar/templates/seminar/archiv/cislo_vysledkovka.tex +++ b/seminar/templates/seminar/archiv/cislo_vysledkovka.tex @@ -1,6 +1,7 @@ \setlength{\tabcolsep}{3pt} +{% if vysledkovka.je_nejake_ostatni %}\vysledkovkaostatnitrue{% endif %} \begin{longtable}{|r|l|c|r|{% for p in vysledkovka.temata_a_spol %}c@{\hskip.5em}{% endfor %}{% if vysledkovka.je_nejake_ostatni %}|c@{\hskip.5em}{% endif %}|r|r|}\hline -& & & & \multicolumn{ {{ vysledkovka.temata_a_spol|length}} }{c|}{\textbf{Témata}} & & {% if vysledkovka.je_nejake_ostatni %}&{\hskip.5em}{% endif %} \\\textbf{Poř.}& \textbf{Jméno}& \textbf{R.}& \raisebox{0.7mm}{$\sum_{-1}$}& {% for p in vysledkovka.temata_a_spol %}\textbf{ {{ p.kod_v_rocniku }} }&{% endfor %}{% if vysledkovka.je_nejake_ostatni %}\textbf{Ostatní}&{% endif %}\raisebox{0.7mm}{$\sum_0$}&\raisebox{0.7mm}{$\sum_1$}\\\hline +& & & & \multicolumn{ {{ vysledkovka.temata_a_spol|length}} }{c|}{\textbf{Témata}} & & {% if vysledkovka.je_nejake_ostatni %}&{\hskip.5em}{% endif %} \\\textbf{Poř.}& \textbf{Jméno}& \textbf{R.}& \raisebox{0.7mm}{$\sum_{-1}$}& {% for p in vysledkovka.temata_a_spol %}\textbf{ {{ p.kod_v_rocniku }} }&{% endfor %}{% if vysledkovka.je_nejake_ostatni %}\textbf{O.}&{% endif %}\raisebox{0.7mm}{$\sum_0$}&\raisebox{0.7mm}{$\sum_1$}\\\hline \endhead \hline \endfoot From 9f421e9d77ed5ef7b879356a896984e10e9a5867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sun, 13 Oct 2024 23:38:17 +0200 Subject: [PATCH 48/49] =?UTF-8?q?Sloupe=C4=8Dek=20ostatn=C3=AD=20ve=20v?= =?UTF-8?q?=C3=BDsledkovce=20(nov=C3=A1=20makra)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/templates/seminar/archiv/cislo_vysledkovka.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seminar/templates/seminar/archiv/cislo_vysledkovka.tex b/seminar/templates/seminar/archiv/cislo_vysledkovka.tex index b8e9f248..4c637524 100644 --- a/seminar/templates/seminar/archiv/cislo_vysledkovka.tex +++ b/seminar/templates/seminar/archiv/cislo_vysledkovka.tex @@ -1,5 +1,5 @@ \setlength{\tabcolsep}{3pt} -{% if vysledkovka.je_nejake_ostatni %}\vysledkovkaostatnitrue{% endif %} +{% if vysledkovka.je_nejake_ostatni %}\global\vysledkovkaostatnitrue{% else %}\global\vysledkovkaostatnifalse{% endif %} \begin{longtable}{|r|l|c|r|{% for p in vysledkovka.temata_a_spol %}c@{\hskip.5em}{% endfor %}{% if vysledkovka.je_nejake_ostatni %}|c@{\hskip.5em}{% endif %}|r|r|}\hline & & & & \multicolumn{ {{ vysledkovka.temata_a_spol|length}} }{c|}{\textbf{Témata}} & & {% if vysledkovka.je_nejake_ostatni %}&{\hskip.5em}{% endif %} \\\textbf{Poř.}& \textbf{Jméno}& \textbf{R.}& \raisebox{0.7mm}{$\sum_{-1}$}& {% for p in vysledkovka.temata_a_spol %}\textbf{ {{ p.kod_v_rocniku }} }&{% endfor %}{% if vysledkovka.je_nejake_ostatni %}\textbf{O.}&{% endif %}\raisebox{0.7mm}{$\sum_0$}&\raisebox{0.7mm}{$\sum_1$}\\\hline \endhead From 133c487637f34cb231bce5afdad20f58947d54e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Sun, 13 Oct 2024 23:39:47 +0200 Subject: [PATCH 49/49] =?UTF-8?q?Sloupe=C4=8Dek=20ostatn=C3=AD=20ve=20v?= =?UTF-8?q?=C3=BDsledkovce=20(nov=C3=A1=20makra)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/templates/seminar/archiv/cislo_vysledkovka.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seminar/templates/seminar/archiv/cislo_vysledkovka.tex b/seminar/templates/seminar/archiv/cislo_vysledkovka.tex index 4c637524..de271652 100644 --- a/seminar/templates/seminar/archiv/cislo_vysledkovka.tex +++ b/seminar/templates/seminar/archiv/cislo_vysledkovka.tex @@ -1,7 +1,7 @@ \setlength{\tabcolsep}{3pt} {% if vysledkovka.je_nejake_ostatni %}\global\vysledkovkaostatnitrue{% else %}\global\vysledkovkaostatnifalse{% endif %} \begin{longtable}{|r|l|c|r|{% for p in vysledkovka.temata_a_spol %}c@{\hskip.5em}{% endfor %}{% if vysledkovka.je_nejake_ostatni %}|c@{\hskip.5em}{% endif %}|r|r|}\hline -& & & & \multicolumn{ {{ vysledkovka.temata_a_spol|length}} }{c|}{\textbf{Témata}} & & {% if vysledkovka.je_nejake_ostatni %}&{\hskip.5em}{% endif %} \\\textbf{Poř.}& \textbf{Jméno}& \textbf{R.}& \raisebox{0.7mm}{$\sum_{-1}$}& {% for p in vysledkovka.temata_a_spol %}\textbf{ {{ p.kod_v_rocniku }} }&{% endfor %}{% if vysledkovka.je_nejake_ostatni %}\textbf{O.}&{% endif %}\raisebox{0.7mm}{$\sum_0$}&\raisebox{0.7mm}{$\sum_1$}\\\hline +& & & & \multicolumn{ {{ vysledkovka.temata_a_spol|length}} }{c|}{\textbf{Témata}} & & {% if vysledkovka.je_nejake_ostatni %}&{\hskip.5em}{% endif %} \\\textbf{Poř.}& \textbf{Jméno}& \textbf{R.}& \raisebox{0.7mm}{$\sum_{-1}$}& {% for p in vysledkovka.temata_a_spol %}\textbf{ {{ p.kod_v_rocniku }} }&{% endfor %}{% if vysledkovka.je_nejake_ostatni %}\textbf{O}&{% endif %}\raisebox{0.7mm}{$\sum_0$}&\raisebox{0.7mm}{$\sum_1$}\\\hline \endhead \hline \endfoot