From 3e9b3d690f82f95eb90a05f72a9b0f5d40012e0b Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 5 Sep 2020 11:23:11 +0200 Subject: [PATCH 1/7] Note is up on note.crans.org --- ansible/base.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/base.yml b/ansible/base.yml index 330089d5..9ec6724d 100755 --- a/ansible/base.yml +++ b/ansible/base.yml @@ -9,7 +9,7 @@ vars: mirror: deb.debian.org note: - server_name: bde-note.adh.crans.org + server_name: note.crans.org roles: - 1-apt-basic - 2-nk20 From d273193b1d672328fd014c0550fb8159c07df618 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 5 Sep 2020 13:51:00 +0200 Subject: [PATCH 2/7] Save the list of changed usernames and lost aliases --- apps/scripts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/scripts b/apps/scripts index 7479671b..69c5c3bb 160000 --- a/apps/scripts +++ b/apps/scripts @@ -1 +1 @@ -Subproject commit 7479671b3f6c499958d3ad991eb54de3010f4da8 +Subproject commit 69c5c3bb36eb2b0554a89d369d9c157292609995 From 2e13356e395de2fc3258224477d3c5bfa8db2001 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 5 Sep 2020 13:52:03 +0200 Subject: [PATCH 3/7] Fix a bug in note saving --- apps/note/models/notes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/note/models/notes.py b/apps/note/models/notes.py index e5d9c13c..604e81ae 100644 --- a/apps/note/models/notes.py +++ b/apps/note/models/notes.py @@ -102,7 +102,7 @@ class Note(PolymorphicModel): super().save(*args, **kwargs) - if not Alias.objects.filter(name=str(self)).exists(): + if not Alias.objects.filter(normalized_name=Alias.normalize(str(self))).exists(): a = Alias(name=str(self)) a.clean() From e73b3cf69d2118fc1cc7508099a0b4cac7d76c1c Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 5 Sep 2020 14:28:05 +0200 Subject: [PATCH 4/7] Fix refresh activities cron --- apps/scripts | 2 +- note.cron | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/scripts b/apps/scripts index 69c5c3bb..4f5a7947 160000 --- a/apps/scripts +++ b/apps/scripts @@ -1 +1 @@ -Subproject commit 69c5c3bb36eb2b0554a89d369d9c157292609995 +Subproject commit 4f5a794798a48cbbf10b42f0a519743fcbb96c33 diff --git a/note.cron b/note.cron index f3e18d90..e0d4e754 100644 --- a/note.cron +++ b/note.cron @@ -3,20 +3,20 @@ # m h dom mon dow user command # Envoyer les mails en attente - * * * * * root cd /var/www/note_kfet && env/bin/python manage.py send_mail >> /var/www/note_kfet/cron_mail.log - * * * * * root cd /var/www/note_kfet && env/bin/python manage.py retry_deferred >> /var/www/note_kfet/cron_mail_deferred.log - 00 0 * * * root cd /var/www/note_kfet && env/bin/python manage.py purge_mail_log 7 >> /var/www/note_kfet/cron_mail_purge.log + * * * * * root cd /var/www/note_kfet && env/bin/python manage.py send_mail + * * * * * root cd /var/www/note_kfet && env/bin/python manage.py retry_deferred + 00 0 * * * root cd /var/www/note_kfet && env/bin/python manage.py purge_mail_log 7 # Faire une sauvegarde de la base de données 00 2 * * * root cd /var/www/note_kfet && apps/scripts/shell/backup_db # Vérifier la cohérence de la base et mailer en cas de problème 00 4 * * * root cd /var/www/note_kfet && env/bin/python manage.py check_consistency --sum-all --check-all --mail # Mettre à jour le wiki (modification sans (dé)validation, activités passées) -#30 5 * * * root cd /var/www/note_kfet && env/bin/python manage.py refresh_activities --raw --comment refresh +#30 5 * * * root cd /var/www/note_kfet && env/bin/python manage.py refresh_activities --raw --comment refresh --wiki # Spammer les gens en négatif 00 5 * * 2 root cd /var/www/note_kfet && env/bin/python manage.py send_mail_to_negative_balances --spam # Envoyer le rapport mensuel aux trésoriers et respos info 00 8 6 * * root cd /var/www/note_kfet && env/bin/python manage.py send_mail_to_negative_balances --report # Envoyer les rapports aux gens 55 6 * * * root cd /var/www/note_kfet && env/bin/python manage.py send_reports -# Envoyer les rapports aux gens +# Mettre à jour les boutons mis en avant 00 9 * * * root cd /var/www/note_kfet && env/bin/python manage.py refresh_highlighted_buttons From 2a8a5cd736b521ae1afd74acde75192f37eefe54 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 5 Sep 2020 14:29:40 +0200 Subject: [PATCH 5/7] Fix some linting, some complex functions are remaining --- apps/activity/tests/test_activities.py | 1 - apps/note/tables.py | 3 ++- apps/treasury/tests/test_treasury.py | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/activity/tests/test_activities.py b/apps/activity/tests/test_activities.py index db83fb0e..99eb2ffb 100644 --- a/apps/activity/tests/test_activities.py +++ b/apps/activity/tests/test_activities.py @@ -7,7 +7,6 @@ from django.contrib.auth.models import User from django.test import TestCase from django.urls import reverse from django.utils import timezone - from activity.models import Activity, ActivityType, Guest, Entry from member.models import Club diff --git a/apps/note/tables.py b/apps/note/tables.py index 0ca50306..f05edc96 100644 --- a/apps/note/tables.py +++ b/apps/note/tables.py @@ -46,7 +46,8 @@ class HistoryTable(tables.Table): } ) - created_at = tables.DateTimeColumn(format='Y-m-d H:i:s', + created_at = tables.DateTimeColumn( + format='Y-m-d H:i:s', attrs={ "td": { "class": "text-nowrap", diff --git a/apps/treasury/tests/test_treasury.py b/apps/treasury/tests/test_treasury.py index 343b91ec..580cfb2d 100644 --- a/apps/treasury/tests/test_treasury.py +++ b/apps/treasury/tests/test_treasury.py @@ -7,7 +7,6 @@ from django.core.exceptions import ValidationError from django.db.models import Q from django.test import TestCase from django.urls import reverse - from member.models import Membership, Club from note.models import SpecialTransaction, NoteSpecial, Transaction from treasury.models import Invoice, Product, Remittance, RemittanceType, SogeCredit From 96954b1afd6ad460a2d008a92232ccf8649a193f Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 5 Sep 2020 14:32:47 +0200 Subject: [PATCH 6/7] Club managers can change the picture of the club note --- apps/permission/fixtures/initial.json | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/apps/permission/fixtures/initial.json b/apps/permission/fixtures/initial.json index 5f266788..a1fa82e5 100644 --- a/apps/permission/fixtures/initial.json +++ b/apps/permission/fixtures/initial.json @@ -2631,6 +2631,22 @@ "description": "Modifier la raison d'invalidité d'une transaction si c'est possible" } }, + { + "model": "permission.permission", + "pk": 169, + "fields": { + "model": [ + "note", + "noteclub" + ], + "query": "{\"pk\": [\"club\", \"pk\"]}", + "type": "change", + "mask": 1, + "field": "display_image", + "permanent": false, + "description": "Changer l'image de la note de son club" + } + }, { "model": "permission.role", "pk": 1, @@ -2726,7 +2742,8 @@ 47, 49, 50, - 141 + 141, + 169 ] } }, @@ -3001,7 +3018,11 @@ 162, 163, 164, - 165 + 165, + 166, + 167, + 168, + 169 ] } }, From 9f619a9df82fb32cb251fd8efea080361f60bc06 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 5 Sep 2020 14:36:49 +0200 Subject: [PATCH 7/7] Center profile picture in transfer interface, closes #61 --- apps/note/templates/note/transaction_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/note/templates/note/transaction_form.html b/apps/note/templates/note/transaction_form.html index 15478219..871088d4 100644 --- a/apps/note/templates/note/transaction_form.html +++ b/apps/note/templates/note/transaction_form.html @@ -37,7 +37,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
{# Preview note profile (picture, username and balance) #}
-
+