Skip to content
Commits on Source (7)
......@@ -6,6 +6,17 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog`_,
and this project adheres to `Semantic Versioning`_.
`2.0rc4`_ - 2021-08-01
----------------------
Fixed
~~~~~
* The lesson documentations tab was displayed on overviews for persons who are not teachers.
* Teachers weren't able to edit personal notes of their students in the person overview.
* The actions to mark absences as excused in the personal notes table also marked personal notes as excused which are not absences.
* The delete action in the personal notes table really deleted the items instead of just resetting them to default values.
`2.0rc3`_ - 2021-07-20
----------------------
......@@ -159,3 +170,4 @@ Fixed
.. _2.0rc1: https://edugit.org/AlekSIS/Official/AlekSIS-App-Alsijil/-/tags/2.0rc1
.. _2.0rc2: https://edugit.org/AlekSIS/Official/AlekSIS-App-Alsijil/-/tags/2.0rc2
.. _2.0rc3: https://edugit.org/AlekSIS/Official/AlekSIS-App-Alsijil/-/tags/2.0rc3
.. _2.0rc4: https://edugit.org/AlekSIS/Official/AlekSIS-App-Alsijil/-/tags/2.0rc4
......@@ -7,18 +7,19 @@ from django.template.loader import get_template
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from aleksis.apps.alsijil.models import PersonalNote
from aleksis.core.models import Notification
def mark_as_excused(modeladmin, request, queryset):
queryset.update(excused=True, excuse_type=None)
queryset.filter(absent=True).update(excused=True, excuse_type=None)
mark_as_excused.short_description = _("Mark as excused")
def mark_as_unexcused(modeladmin, request, queryset):
queryset.update(excused=False, excuse_type=None)
queryset.filter(absent=True).update(excused=False, excuse_type=None)
mark_as_unexcused.short_description = _("Mark as unexcused")
......@@ -26,7 +27,7 @@ mark_as_unexcused.short_description = _("Mark as unexcused")
def mark_as_excuse_type_generator(excuse_type) -> Callable:
def mark_as_excuse_type(modeladmin, request, queryset):
queryset.update(excused=True, excuse_type=excuse_type)
queryset.filter(absent=True).update(excused=True, excuse_type=excuse_type)
mark_as_excuse_type.short_description = _(f"Mark as {excuse_type.name}")
mark_as_excuse_type.__name__ = f"mark_as_excuse_type_{excuse_type.short_name}"
......@@ -35,7 +36,11 @@ def mark_as_excuse_type_generator(excuse_type) -> Callable:
def delete_personal_note(modeladmin, request, queryset):
queryset.delete()
notes = []
for personal_note in queryset:
personal_note.reset_values()
notes.append(personal_note)
PersonalNote.objects.bulk_update(notes)
delete_personal_note.short_description = _("Delete")
......
......@@ -189,7 +189,7 @@ add_perm(
)
# Edit person overview personal notes
edit_person_overview_personal_notes_predicate = view_person_overview_personal_notes_predicate & (
edit_person_overview_personal_notes_predicate = view_person_overview_predicate & (
~is_current_person
| has_global_perm("alsijil.edit_personalnote")
| has_person_group_object_perm("core.edit_personalnote_group")
......
......@@ -876,7 +876,9 @@ def overview_person(request: HttpRequest, id_: Optional[int] = None) -> HttpResp
context["excuse_types"] = ExcuseType.objects.all()
form = PersonOverviewForm(request, request.POST or None, queryset=allowed_personal_notes)
if request.method == "POST":
if request.method == "POST" and request.user.has_perm(
"alsijil.edit_person_overview_personalnote_rule", person
):
if form.is_valid():
with reversion.create_revision():
reversion.set_user(request.user)
......@@ -957,7 +959,7 @@ def overview_person(request: HttpRequest, id_: Optional[int] = None) -> HttpResp
filter_dict["person"] = person
context["filter_form"] = filter_form
if request.user.person.is_teacher:
if person.is_teacher:
register_objects = generate_list_of_all_register_objects(filter_dict)
table = RegisterObjectTable(register_objects)
items_per_page = request.user.person.preferences[
......
......@@ -66,7 +66,7 @@ reference = "gitlab"
[[package]]
name = "aleksis-core"
version = "2.1.dev0+20210719212818.c009dc54"
version = "2.1.dev0+20210729094035.c0b56c31"
description = "AlekSIS (School Information System) — Core"
category = "main"
optional = false
......@@ -82,7 +82,7 @@ colour = ">=0.1.5,<0.2.0"
Django = ">=3.2,<4.0"
django-allauth = ">=0.45.0,<0.46.0"
django-any-js = ">=1.1,<2.0"
django-bleach = ">=0.6.1,<0.7.0"
django-bleach = ">=0.7.0,<0.8.0"
django-cachalot = ">=2.3.2,<3.0.0"
django-cache-memoize = ">=0.1.6,<0.2.0"
django-celery-beat = ">=2.2.0,<3.0.0"
......@@ -435,7 +435,7 @@ pycparser = "*"
[[package]]
name = "charset-normalizer"
version = "2.0.3"
version = "2.0.4"
description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
category = "main"
optional = false
......@@ -662,7 +662,7 @@ django = "*"
[[package]]
name = "django-bleach"
version = "0.6.1"
version = "0.7.2"
description = "Easily use bleach with Django models and templates"
category = "main"
optional = false
......@@ -696,7 +696,7 @@ Django = ">=2.2,<3.3"
[[package]]
name = "django-cache-memoize"
version = "0.1.9"
version = "0.1.10"
description = "Django utility for a memoization decorator that uses the Django cache framework."
category = "main"
optional = false
......@@ -911,11 +911,11 @@ python-versions = "*"
[[package]]
name = "django-ipware"
version = "3.0.2"
description = "A Django utility application that returns client's real IP address"
version = "3.0.7"
description = "A Django application to retrieve user's IP address"
category = "main"
optional = false
python-versions = "*"
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*"
[[package]]
name = "django-js-asset"
......@@ -1316,7 +1316,7 @@ yaml = ["ruamel.yaml"]
[[package]]
name = "faker"
version = "8.10.1"
version = "8.10.3"
description = "Faker is a Python package that generates fake data for you."
category = "main"
optional = false
......@@ -1488,7 +1488,7 @@ smmap = ">=3.0.1,<5"
[[package]]
name = "gitpython"
version = "3.1.18"
version = "3.1.20"
description = "Python Git Library"
category = "dev"
optional = false
......@@ -1496,6 +1496,7 @@ python-versions = ">=3.6"
[package.dependencies]
gitdb = ">=4.0.1,<5"
typing-extensions = {version = ">=3.7.4.3", markers = "python_version < \"3.10\""}
[[package]]
name = "haystack-redis"
......@@ -1584,7 +1585,7 @@ python-versions = "*"
[[package]]
name = "isort"
version = "5.9.2"
version = "5.9.3"
description = "A Python utility / library to sort Python imports."
category = "dev"
optional = false
......@@ -1821,7 +1822,7 @@ ptyprocess = ">=0.5"
[[package]]
name = "pg8000"
version = "1.20.0"
version = "1.21.0"
description = "PostgreSQL interface library"
category = "dev"
optional = false
......@@ -1832,7 +1833,7 @@ scramp = ">=1.4.0"
[[package]]
name = "phonenumbers"
version = "8.12.27"
version = "8.12.28"
description = "Python version of Google's common library for parsing, formatting, storing and validating international phone numbers."
category = "main"
optional = false
......@@ -2547,7 +2548,7 @@ python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
[[package]]
name = "tqdm"
version = "4.61.2"
version = "4.62.0"
description = "Fast, Extensible Progress Meter"
category = "main"
optional = false
......@@ -2577,7 +2578,7 @@ test = ["pytest"]
[[package]]
name = "twilio"
version = "6.62.0"
version = "6.62.1"
description = "Twilio API client and TwiML generator"
category = "main"
optional = false
......@@ -2687,8 +2688,8 @@ aleksis-builddeps = [
{file = "AlekSIS-Builddeps-4.tar.gz", hash = "sha256:aaaa22965228b9b9b7de812e3e7fa9cbfdbf8635bb22d6f3a201dc0cc6d8d307"},
]
aleksis-core = [
{file = "AlekSIS-Core-2.1.dev0+20210719212818.c009dc54.tar.gz", hash = "sha256:d1ce8ea2f0c887047232eb91cf049332dc87f54c14b631521aae18bd114d56fc"},
{file = "AlekSIS_Core-2.1.dev0+20210719212818.c009dc54-py3-none-any.whl", hash = "sha256:717aa3442c9a41875594706fccc7b2719753be000d5aa3b5082efbfbe73a5722"},
{file = "AlekSIS-Core-2.1.dev0+20210729094035.c0b56c31.tar.gz", hash = "sha256:b125c662c0621019646a22d206aebf0856f937f7154ac03914c9e414e8c69f20"},
{file = "AlekSIS_Core-2.1.dev0+20210729094035.c0b56c31-py3-none-any.whl", hash = "sha256:5ce65c7f9b5d7a9c513d600603da85d3536ca85e7a7fbb599e0af23921cf6e5e"},
]
amqp = [
{file = "amqp-5.0.6-py3-none-any.whl", hash = "sha256:493a2ac6788ce270a2f6a765b017299f60c1998f5a8617908ee9be082f7300fb"},
......@@ -2822,8 +2823,8 @@ cffi = [
{file = "cffi-1.14.6.tar.gz", hash = "sha256:c9a875ce9d7fe32887784274dd533c57909b7b1dcadcc128a2ac21331a9765dd"},
]
charset-normalizer = [
{file = "charset-normalizer-2.0.3.tar.gz", hash = "sha256:c46c3ace2d744cfbdebceaa3c19ae691f53ae621b39fd7570f59d14fb7f2fd12"},
{file = "charset_normalizer-2.0.3-py3-none-any.whl", hash = "sha256:88fce3fa5b1a84fdcb3f603d889f723d1dd89b26059d0123ca435570e848d5e1"},
{file = "charset-normalizer-2.0.4.tar.gz", hash = "sha256:f23667ebe1084be45f6ae0538e4a5a865206544097e4e8bbcacf42cd02a348f3"},
{file = "charset_normalizer-2.0.4-py3-none-any.whl", hash = "sha256:0c8911edd15d19223366a194a513099a302055a962bca2cec0f54b8b63175d8b"},
]
click = [
{file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"},
......@@ -2955,8 +2956,8 @@ django-appconf = [
{file = "django_appconf-1.0.4-py2.py3-none-any.whl", hash = "sha256:1b1d0e1069c843ebe8ae5aa48ec52403b1440402b320c3e3a206a0907e97bb06"},
]
django-bleach = [
{file = "django-bleach-0.6.1.tar.gz", hash = "sha256:674709c26040618aff0741ce8261fd151e5ead405bd50568c2034662d69daac3"},
{file = "django_bleach-0.6.1-py2.py3-none-any.whl", hash = "sha256:59de95cd98f924992313821ab7f94cd64a03aa900ca980bd3b062d8aef1a7954"},
{file = "django-bleach-0.7.2.tar.gz", hash = "sha256:2afc7ed5a10395b0bf84dfd43999305f77120902468071c18a7b666dcf5421bf"},
{file = "django_bleach-0.7.2-py2.py3-none-any.whl", hash = "sha256:8761714ff9737c81e595f0a362a0527fac31cf8208157f6d5f49c06863b21bad"},
]
django-bulk-update = [
{file = "django-bulk-update-2.2.0.tar.gz", hash = "sha256:5ab7ce8a65eac26d19143cc189c0f041d5c03b9d1b290ca240dc4f3d6aaeb337"},
......@@ -2967,8 +2968,8 @@ django-cachalot = [
{file = "django_cachalot-2.4.2-py3-none-any.whl", hash = "sha256:1d5c47e56425afc0b7131696d7894ed5c9d85cb6994282a02fe3d8bc274e1bd3"},
]
django-cache-memoize = [
{file = "django-cache-memoize-0.1.9.tar.gz", hash = "sha256:31f9d45fc1374d64963c5490877b857d3160d9b9047e40e40ed721345ca32bf3"},
{file = "django_cache_memoize-0.1.9-py3-none-any.whl", hash = "sha256:01b209488d3b62d2de362de82d55098f7393e36d31c6e220fa88165e3556aa28"},
{file = "django-cache-memoize-0.1.10.tar.gz", hash = "sha256:63e8faa245a41c0dbad843807e9f21a6e59eba8e6e50df310fdf6485a6749843"},
{file = "django_cache_memoize-0.1.10-py3-none-any.whl", hash = "sha256:676299313079cde9242ae84db0160e80b1d44e8dd6bc9b1f4f1247e11b30c9e0"},
]
django-celery-beat = [
{file = "django-celery-beat-2.2.1.tar.gz", hash = "sha256:97ae5eb309541551bdb07bf60cc57cadacf42a74287560ced2d2c06298620234"},
......@@ -3040,7 +3041,8 @@ django-impersonate = [
{file = "django-impersonate-1.7.3.tar.gz", hash = "sha256:282003957577c7143fe31e5861f8fffdf6fe0c25557aedb28fcf8b11474eaa23"},
]
django-ipware = [
{file = "django-ipware-3.0.2.tar.gz", hash = "sha256:c7df8e1410a8e5d6b1fbae58728402ea59950f043c3582e033e866f0f0cf5e94"},
{file = "django-ipware-3.0.7.tar.gz", hash = "sha256:753f8214a16ccaac54ea977349a96e37b582a28a54065e00c1c46d530862c85e"},
{file = "django_ipware-3.0.7-py2.py3-none-any.whl", hash = "sha256:a18820ea2b98ff3f87b7530eb6346f5feb65d18e89397606aacc098fa7b93db2"},
]
django-js-asset = [
{file = "django-js-asset-1.2.2.tar.gz", hash = "sha256:c163ae80d2e0b22d8fb598047cd0dcef31f81830e127cfecae278ad574167260"},
......@@ -3169,8 +3171,8 @@ dynaconf = [
{file = "dynaconf-3.1.4.tar.gz", hash = "sha256:b2f472d83052f809c5925565b8a2ba76a103d5dc1dbb9748b693ed67212781b9"},
]
faker = [
{file = "Faker-8.10.1-py3-none-any.whl", hash = "sha256:9ac6b39b9618f55be6b8b45089e624564469a035cc845c69ce990332ce3663f4"},
{file = "Faker-8.10.1.tar.gz", hash = "sha256:a665e6e2e9087ec9ad4ebcd2f09acd031b44193ee93401817001b6557c6502b4"},
{file = "Faker-8.10.3-py3-none-any.whl", hash = "sha256:f27a2a5c34042752f9d5fea2a9667aed5265d7d7bdd5ce83bc03b2f8a540d148"},
{file = "Faker-8.10.3.tar.gz", hash = "sha256:771b21ab55924867ac865f4b0c2f547c200172293b1056be16289584ef1215cb"},
]
flake8 = [
{file = "flake8-3.9.2-py2.py3-none-any.whl", hash = "sha256:bf8fd333346d844f616e8d47905ef3a3384edae6b4e9beb0c5101e25e3110907"},
......@@ -3224,8 +3226,8 @@ gitdb = [
{file = "gitdb-4.0.7.tar.gz", hash = "sha256:96bf5c08b157a666fec41129e6d327235284cca4c81e92109260f353ba138005"},
]
gitpython = [
{file = "GitPython-3.1.18-py3-none-any.whl", hash = "sha256:fce760879cd2aebd2991b3542876dc5c4a909b30c9d69dfc488e504a8db37ee8"},
{file = "GitPython-3.1.18.tar.gz", hash = "sha256:b838a895977b45ab6f0cc926a9045c8d1c44e2b653c1fcc39fe91f42c6e8f05b"},
{file = "GitPython-3.1.20-py3-none-any.whl", hash = "sha256:b1e1c269deab1b08ce65403cf14e10d2ef1f6c89e33ea7c5e5bb0222ea593b8a"},
{file = "GitPython-3.1.20.tar.gz", hash = "sha256:df0e072a200703a65387b0cfdf0466e3bab729c0458cf6b7349d0e9877636519"},
]
haystack-redis = [
{file = "haystack-redis-0.0.1.tar.gz", hash = "sha256:ccfea88bdc1387c9f7f6f19e9bc062a3612039ef94cfd3e78cf59a96ddd269b2"},
......@@ -3256,8 +3258,8 @@ ipython-genutils = [
{file = "ipython_genutils-0.2.0.tar.gz", hash = "sha256:eb2e116e75ecef9d4d228fdc66af54269afa26ab4463042e33785b887c628ba8"},
]
isort = [
{file = "isort-5.9.2-py3-none-any.whl", hash = "sha256:eed17b53c3e7912425579853d078a0832820f023191561fcee9d7cae424e0813"},
{file = "isort-5.9.2.tar.gz", hash = "sha256:f65ce5bd4cbc6abdfbe29afc2f0245538ab358c14590912df638033f157d555e"},
{file = "isort-5.9.3-py3-none-any.whl", hash = "sha256:e17d6e2b81095c9db0a03a8025a957f334d6ea30b26f9ec70805411e5c7c81f2"},
{file = "isort-5.9.3.tar.gz", hash = "sha256:9c2ea1e62d871267b78307fe511c0838ba0da28698c5732d54e2790bf3ba9899"},
]
jedi = [
{file = "jedi-0.18.0-py2.py3-none-any.whl", hash = "sha256:18456d83f65f400ab0c2d3319e48520420ef43b23a086fdc05dff34132f0fb93"},
......@@ -3395,12 +3397,12 @@ pexpect = [
{file = "pexpect-4.8.0.tar.gz", hash = "sha256:fc65a43959d153d0114afe13997d439c22823a27cefceb5ff35c2178c6784c0c"},
]
pg8000 = [
{file = "pg8000-1.20.0-py3-none-any.whl", hash = "sha256:f984e8e309876202b3fa4b170467eb716574ebd571330d9d65eb13446876cf04"},
{file = "pg8000-1.20.0.tar.gz", hash = "sha256:490ec22a92601f0454b3ed4c8d4ecddc30f66c0e3f783f0ecc581037749a8c55"},
{file = "pg8000-1.21.0-py3-none-any.whl", hash = "sha256:02cb4ae1495ff2db4be89cefc72ae131d34af98264fdd6c29106731b33e10356"},
{file = "pg8000-1.21.0.tar.gz", hash = "sha256:c99108c630b1c468668a8def38be4c91b2fb7cf0154ce7918e7a3912e60652d7"},
]
phonenumbers = [
{file = "phonenumbers-8.12.27-py2.py3-none-any.whl", hash = "sha256:64ecba30985d580d03086598d977dba812ac499514f2e1f8a2795af2f0de1aa6"},
{file = "phonenumbers-8.12.27.tar.gz", hash = "sha256:856f6bebf19eafe5ab1d50b2f4972f8d7474a7e1b8c0f9cf3263a26602ac81f3"},
{file = "phonenumbers-8.12.28-py2.py3-none-any.whl", hash = "sha256:f8ce05f82955d2faeefe2303350b2ccb7369dd39b6e45231a09475d67eb7e83b"},
{file = "phonenumbers-8.12.28.tar.gz", hash = "sha256:42ea4f946d5cce0056cbce257842ea6b281e69828ad2e7f27b29d3908e5b06bd"},
]
pickleshare = [
{file = "pickleshare-0.7.5-py2.py3-none-any.whl", hash = "sha256:9649af414d74d4df115d5d718f82acb59c9d418196b7b4290ed47a12ce62df56"},
......@@ -3833,15 +3835,15 @@ toml = [
{file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"},
]
tqdm = [
{file = "tqdm-4.61.2-py2.py3-none-any.whl", hash = "sha256:5aa445ea0ad8b16d82b15ab342de6b195a722d75fc1ef9934a46bba6feafbc64"},
{file = "tqdm-4.61.2.tar.gz", hash = "sha256:8bb94db0d4468fea27d004a0f1d1c02da3cdedc00fe491c0de986b76a04d6b0a"},
{file = "tqdm-4.62.0-py2.py3-none-any.whl", hash = "sha256:706dea48ee05ba16e936ee91cb3791cd2ea6da348a0e50b46863ff4363ff4340"},
{file = "tqdm-4.62.0.tar.gz", hash = "sha256:3642d483b558eec80d3c831e23953582c34d7e4540db86d9e5ed9dad238dabc6"},
]
traitlets = [
{file = "traitlets-5.0.5-py3-none-any.whl", hash = "sha256:69ff3f9d5351f31a7ad80443c2674b7099df13cc41fc5fa6e2f6d3b0330b0426"},
{file = "traitlets-5.0.5.tar.gz", hash = "sha256:178f4ce988f69189f7e523337a3e11d91c786ded9360174a3d9ca83e79bc5396"},
]
twilio = [
{file = "twilio-6.62.0.tar.gz", hash = "sha256:f681f908ab641fae325f08555d0224a27239a82051f16d6239c316bb0e005cbc"},
{file = "twilio-6.62.1.tar.gz", hash = "sha256:18abcd69049b150a90d543b59d246ac6fd7a4db08c3fdbe600534de60f71345b"},
]
typed-ast = [
{file = "typed_ast-1.4.3-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:2068531575a125b87a41802130fa7e29f26c09a2833fea68d9a40cf33902eba6"},
......
[tool.poetry]
name = "AlekSIS-App-Alsijil"
version = "2.0rc3"
version = "2.0rc4"
packages = [
{ include = "aleksis" }
]
......