From 96f3149b598582fa7f4d3428ba099dc44da5763f Mon Sep 17 00:00:00 2001 From: Hugo Levy-Falk Date: Mon, 11 Jan 2021 22:02:35 +0100 Subject: [PATCH 1/5] BuG fixes :) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3bf2a23..024c96ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,7 +60,7 @@ Here is a list of noteworthy features brought by this update: * [!578](https://gitlab.federez.net/re2o/re2o/-/merge_requests/578) : Migrations squashed to ease the installation process. * [!582](https://gitlab.federez.net/re2o/re2o/-/merge_requests/582): Improve autocomplete fields so they load faster and have a clearer behavior (no more entering a value without clicking and thinking it was taken into account). * [!589](https://gitlab.federez.net/re2o/re2o/-/merge_requests/589): Move LDAP to a separate optional app. -* Plenty of bux fixes. +* Plenty of bug fixes. You can view the full list of closed issues [here](https://gitlab.federez.net/re2o/re2o/-/issues?scope=all&state=all&milestone_title=Re2o 2.9). From fda4c481b0478896da7492ffdcb8a1b6a20d9ff4 Mon Sep 17 00:00:00 2001 From: Jean-Romain Garnier Date: Mon, 11 Jan 2021 22:14:08 +0100 Subject: [PATCH 2/5] Add missing update step details in CHANGELOG.md --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 024c96ce..88a30368 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,15 +30,16 @@ sudo pip3 install -r pip_requirements.txt python3 manage.py collectstatic ``` -### MR 589: Move ldap to optional app +### MR 589: Move LDAP to optional app -Add `ldap_sync` to your optional apps in your local settings if you want to keep using the LDAP synchronisation. +Add `ldap_sync` to your optional apps in your local settings (`re2o/settings_local.py`) if you want to keep using the LDAP synchronisation. ### Final steps As usual, run the following commands after updating: ```bash python3 manage.py migrate +python3 manage.py compilemessages sudo service apache2 reload ``` From e215c63abb8133ce8aeaec59c70a7a79fe7a5b03 Mon Sep 17 00:00:00 2001 From: Hugo Levy-Falk Date: Mon, 11 Jan 2021 23:17:48 +0100 Subject: [PATCH 3/5] Thanks to our contributors --- .mailmap | 84 ++++++++++++++++++++++++++++++++++++++++++++ re2o/contributors.py | 79 ++++++++++++++++++++++------------------- 2 files changed, 126 insertions(+), 37 deletions(-) create mode 100644 .mailmap diff --git a/.mailmap b/.mailmap new file mode 100644 index 00000000..e42dc8b5 --- /dev/null +++ b/.mailmap @@ -0,0 +1,84 @@ +Gabriel Detraz +Gabriel Detraz +Gabriel Detraz +Gabriel Detraz +Gabriel Detraz +Gabriel Detraz +Gabriel Detraz +Gabriel Detraz +Gabriel Detraz +Gabriel Detraz +Gabriel Detraz +Gabriel Detraz +Gabriel Detraz +Gabriel Detraz +Gabriel Detraz +Maël Kervella +Maël Kervella +Maël Kervella +Jean-Romain Garnier +Jean-Romain Garnier +Hugo Levy-Falk +Hugo Levy-Falk +Hugo Levy-Falk +Hugo Levy-Falk +Arthur Grisel-Davy +Arthur Grisel-Davy +Arthur Grisel-Davy +Arthur Grisel-Davy +Arthur Grisel-Davy +Arthur Grisel-Davy +Arthur Grisel-Davy +Arthur Grisel-Davy +Lara Kermarec +Lara Kermarec +Lara Kermarec +Lara Kermarec +Lara Kermarec +Lara Kermarec +Augustin Lemesle +Augustin Lemesle +Corentin Canebier +Corentin Canebier +Root `root` Root +Root `root` Root +Root `root` Root +Root `root` Root +Root `root` Root +Root `root` Root +Root `root` Root +Root `root` Root +Root `root` Root +Root `root` Root +Root `root` Root +Yoann Piétri +Yoann Piétri +Guillaume Goessel +Guillaume Goessel +Guillaume Goessel +Guillaume Goessel +David Sinquin +David Sinquin +David Sinquin +Matthieu Michelet +Matthieu Michelet +Jean-Marie Mineau +~anonymised~ +~anonymised~ +Thibault de Boutray +Thibault de Boutray +Fardale +Fardale +Laouen Fernet +Laouen Fernet FERNET Laouen +Bombar Maxime +Leïla Bekaddour +Leïla Bekaddour +edpibu +edpibu +Éloi Alain +Éloi Alain +Gabriel Le Bouder +Gabriel Le Bouder +Charlie Jacomme +Charlie Jacomme diff --git a/re2o/contributors.py b/re2o/contributors.py index bdcf5f9a..b8b04eb2 100644 --- a/re2o/contributors.py +++ b/re2o/contributors.py @@ -4,40 +4,45 @@ A list of the proud contributors to Re2o """ CONTRIBUTORS = [ - "Gabriel 'chibrac' Detraz", - "Hugo 'klafyvel' Levy-Falk", - "Maël 'MoaMoaK' Kervella", - "Arthur 'Grizzly' Grisel-Davy", - "Augustin 'Dalahro' Lemesle", - "Laouen 'volgarr' Fernet", - "Lara 'lhark' Kermarec", - "Alexandre 'erdnaxe' Ioss", - "Charlie Jacomme", - "Root 'root' Root", - "Yoann 'nanoy' Pietri", - "Maxime Bombar", - "Matthieu 'lebanni' Michelet", - "Guillaume 'guimoz' Goessel", - "edpibu", - "Jean-Romain 'lerennais' Garnier", - "David '5-1' Sinquin", - "Gabriel Le Bouder", - "Fardale", - "Éloi Alain", - "Simon Brelivet", - "Antoine Vintache", - "Benjamin Graillot", - "Thibault 'tipunchetrhum' Deboutray", - "Joanne Steiner", - "Delphine Salvy", - "Pierre Cadart", - "'Krokmou'", - "Vincent Le Gallic", - "Hugo 'shaka' Hervieux", - "Pierre-Antoine Comby", - "Nymous", - "Mikachu", - "Baptiste 'B' Fournier", - "Gwenael Le Hir", - "Daniel Stan", -] + 'Gabriel Detraz', + 'Hugo Levy-falk', + 'Maël Kervella', + 'Jean-romain Garnier', + 'Arthur Grisel-davy', + 'Laouen Fernet', + 'Augustin Lemesle', + 'Lara Kermarec', + 'Root `root` Root', + 'Alexandre Iooss', + 'Yoann Piétri', + 'Charlie Jacomme', + 'Corentin Canebier', + 'Bombar Maxime', + 'Guillaume Goessel', + 'Matthieu Michelet', + 'Edpibu', + 'Fardale', + 'Jean-marie Mineau', + 'David Sinquin', + 'Gabriel Le Bouder', + 'Simon Brélivet', + '~anonymised~', + 'Leïla Bekaddour', + 'Éloi Alain', + 'Benjamin Graillot', + 'Pierre Cadart', + 'Antoine Vintache', + 'Thibault De Boutray', + 'Delphine Salvy', + 'Joanne Steiner', + 'Krokmou', + 'B', + 'Daniel Stan', + 'Gwenael Le Hir', + 'Hugo Hervieux', + 'Mikachu', + 'Nymous', + 'Pierre-antoine Comby', + 'Vincent Le Gallic', + 'Esum', +] \ No newline at end of file From 4fc51b761f07f384bdd9ded9b1612afa6967a533 Mon Sep 17 00:00:00 2001 From: Hugo Levy-Falk Date: Mon, 11 Jan 2021 23:30:53 +0100 Subject: [PATCH 4/5] I forgot Esum. --- .mailmap | 2 ++ re2o/contributors.py | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.mailmap b/.mailmap index e42dc8b5..fc7dde8f 100644 --- a/.mailmap +++ b/.mailmap @@ -82,3 +82,5 @@ Gabriel Le Bouder Gabriel Le Bouder Charlie Jacomme Charlie Jacomme +Benjamin Graillot +Benjamin Graillot diff --git a/re2o/contributors.py b/re2o/contributors.py index b8b04eb2..cbca94f0 100644 --- a/re2o/contributors.py +++ b/re2o/contributors.py @@ -27,9 +27,9 @@ CONTRIBUTORS = [ 'Gabriel Le Bouder', 'Simon Brélivet', '~anonymised~', + 'Benjamin Graillot', 'Leïla Bekaddour', 'Éloi Alain', - 'Benjamin Graillot', 'Pierre Cadart', 'Antoine Vintache', 'Thibault De Boutray', @@ -44,5 +44,4 @@ CONTRIBUTORS = [ 'Nymous', 'Pierre-antoine Comby', 'Vincent Le Gallic', - 'Esum', ] \ No newline at end of file From d5bdc7fe419e67b6d460651bd3f4e9374e70476b Mon Sep 17 00:00:00 2001 From: Hugo Levy-Falk Date: Tue, 12 Jan 2021 19:08:17 +0100 Subject: [PATCH 5/5] Fix: Forgotten legacy `ldap_sync` calls in `machines` and `cotisations`. --- cotisations/models.py | 10 ++++++---- machines/models.py | 9 +++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cotisations/models.py b/cotisations/models.py index 5dc18e4f..74be4285 100644 --- a/cotisations/models.py +++ b/cotisations/models.py @@ -50,6 +50,8 @@ from preferences.models import CotisationsOption from machines.models import regen from re2o.field_permissions import FieldPermissionModelMixin from re2o.mixins import AclMixin, RevMixin +import users.signals +import users.models from cotisations.utils import find_payment_method, send_mail_invoice, send_mail_voucher from cotisations.validators import check_no_balance @@ -356,7 +358,7 @@ def facture_post_save(**kwargs): if facture.valid: user = facture.user user.set_active() - user.ldap_sync(base=False, access_refresh=True, mac_refresh=False) + users.signals.synchronise.send(sender=users.models.User, instance=user, base=False, access_refresh=True, mac_refresh=False) @receiver(post_delete, sender=Facture) @@ -365,7 +367,7 @@ def facture_post_delete(**kwargs): Synchronise the LDAP user after an invoice has been deleted. """ user = kwargs["instance"].user - user.ldap_sync(base=False, access_refresh=True, mac_refresh=False) + users.signals.synchronise.send(sender=users.models.User, instance=user, base=False, access_refresh=True, mac_refresh=False) class CustomInvoice(BaseInvoice): @@ -661,7 +663,7 @@ def vente_post_save(**kwargs): purchase.cotisation.save() user = purchase.facture.facture.user user.set_active() - user.ldap_sync(base=True, access_refresh=True, mac_refresh=False) + users.signals.synchronise.send(sender=users.models.User, instance=user, base=True, access_refresh=True, mac_refresh=False) # TODO : change vente to purchase @@ -677,7 +679,7 @@ def vente_post_delete(**kwargs): return if purchase.type_cotisation: user = invoice.user - user.ldap_sync(base=False, access_refresh=True, mac_refresh=False) + users.signals.synchronise.send(sender=users.models.User, instance=user, base=True, access_refresh=True, mac_refresh=False) class Article(RevMixin, AclMixin, models.Model): diff --git a/machines/models.py b/machines/models.py index 5884d975..ad2b5a42 100644 --- a/machines/models.py +++ b/machines/models.py @@ -58,6 +58,7 @@ from netaddr import ( import preferences.models import users.models +import users.signals from re2o.field_permissions import FieldPermissionModelMixin from re2o.mixins import AclMixin, RevMixin @@ -2541,7 +2542,7 @@ class OuverturePort(RevMixin, AclMixin, models.Model): def machine_post_save(**kwargs): """Synchronise LDAP and regen firewall/DHCP after a machine is edited.""" user = kwargs["instance"].user - user.ldap_sync(base=False, access_refresh=False, mac_refresh=True) + users.signals.synchronise.send(sender=users.models.User, instance=user, base=False, access_refresh=False, mac_refresh=True) regen("dhcp") regen("mac_ip_list") @@ -2551,7 +2552,7 @@ def machine_post_delete(**kwargs): """Synchronise LDAP and regen firewall/DHCP after a machine is deleted.""" machine = kwargs["instance"] user = machine.user - user.ldap_sync(base=False, access_refresh=False, mac_refresh=True) + users.signals.synchronise.send(sender=users.models.User, instance=user, base=False, access_refresh=False, mac_refresh=True) regen("dhcp") regen("mac_ip_list") @@ -2564,7 +2565,7 @@ def interface_post_save(**kwargs): interface = kwargs["instance"] interface.sync_ipv6() user = interface.machine.user - user.ldap_sync(base=False, access_refresh=False, mac_refresh=True) + users.signals.synchronise.send(sender=users.models.User, instance=user, base=False, access_refresh=False, mac_refresh=True) # Regen services regen("dhcp") regen("mac_ip_list") @@ -2580,7 +2581,7 @@ def interface_post_delete(**kwargs): """ interface = kwargs["instance"] user = interface.machine.user - user.ldap_sync(base=False, access_refresh=False, mac_refresh=True) + users.signals.synchronise.send(sender=users.models.User, instance=user, base=False, access_refresh=False, mac_refresh=True) @receiver(post_save, sender=IpType)