From 680b22d7e648ca9f3b95acc150d8ad51735725ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= Date: Tue, 5 Jan 2021 16:42:48 +0100 Subject: [PATCH 01/27] Docker, Give default value to email settings --- CHANGELOG.md | 3 +++ docker/geocontrib/settings.py | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c86398b..f02bd80f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## Unreleased +### Fixed +- Docker, give default values for email configuration + ## [1.2.0] - 2020-12-17 ### Changed diff --git a/docker/geocontrib/settings.py b/docker/geocontrib/settings.py index f7909768..0d102fe9 100644 --- a/docker/geocontrib/settings.py +++ b/docker/geocontrib/settings.py @@ -159,12 +159,12 @@ # E-mail and notification parameters EMAIL_BACKEND = config('EMAIL_BACKEND', default="django.core.mail.backends.console.EmailBackend") -EMAIL_HOST = config('EMAIL_HOST') -EMAIL_HOST_USER = config('EMAIL_HOST_USER') -EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD') -EMAIL_PORT = config('EMAIL_PORT', cast=int) -EMAIL_USE_TLS = config('EMAIL_USE_TLS', cast=bool) -DEFAULT_FROM_EMAIL = config('DEFAULT_FROM_EMAIL') +EMAIL_HOST = config('EMAIL_HOST', default="") +EMAIL_HOST_USER = config('EMAIL_HOST_USER', default="") +EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD', default="") +EMAIL_PORT = config('EMAIL_PORT', cast=int, default=22) +EMAIL_USE_TLS = config('EMAIL_USE_TLS', cast=bool, default=True) +DEFAULT_FROM_EMAIL = config('DEFAULT_FROM_EMAIL', default="") # Notification frequency (allowed values: 'never', 'instantly', 'daily', 'weekly') DEFAULT_SENDING_FREQUENCY = config('DEFAULT_SENDING_FREQUENCY', default='never') From dfd28c1ac6d5e15342859c105bcd79b6ec0efd68 Mon Sep 17 00:00:00 2001 From: e-babani <37336064+e-babani@users.noreply.github.com> Date: Wed, 13 Jan 2021 14:10:05 +0100 Subject: [PATCH 02/27] Update CHANGELOG.md --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f02bd80f..a4e0626e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Redmine 8551: Can import features files with extention "geojson" in addition to "json" - Redmine 9330: A feature type can be duplicated - Redmine 9329: Can turn a project into a project template and instatiate a project from a project model +- Redmine 9544: Addition of Sortable JS library +- Redmine 9507: Added help on authorized characters +- Redmine 9331: Reports with identical geometry are considered to be duplicates - Django admin improvements - Projects list ordered by title - FeatureType list ordered by project, title @@ -23,12 +26,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - FeatureType geom editable on create (read-only on update) - CustomField list ordered by feature_type, label - Project creator required (fixing 500 on edit) + - Added help on authorized characters when user create a view PostgreSQL ### Fixed - Docker, prevent creating files not readable by nginx - Redmine 9706: The modification of the basemap form are recorded - Redmine 9654: Creating a basemap without title doesn't crash - Redmine 9623: A connected user doesn't see achived features if he is not allowed +- Redmine 9745: Geolocalised images are visible +- Redmine 9619 : Fix bug for project creation from Django +- Redmine 9490: Fix bug when a custom field is duplicated +- Redmine 9527: Show "0" instead of « None » in the project settings +- Redmine 9526: Fix bug for view creation from Django +- Redmine 9498: Display the login if the user does not have a first and last name +- Redmine 9402: Return to the project page after modifying the project +- Redmine 9401: Error message if the archiving time is greater than the deletion time ## [1.1.3] - 2020-11-13 From ad9b4dd893bd3be95d879f1acd124e8fedf50920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= Date: Thu, 14 Jan 2021 14:23:54 +0100 Subject: [PATCH 03/27] Feat/docker improve (#87) rename docker-compose default file --- .github/workflows/geocontrib.yml | 2 +- .gitignore | 4 +++- ...cker-compose.geocontrib-alone.yaml => docker-compose.yaml} | 0 3 files changed, 4 insertions(+), 2 deletions(-) rename docker/{docker-compose.geocontrib-alone.yaml => docker-compose.yaml} (100%) diff --git a/.github/workflows/geocontrib.yml b/.github/workflows/geocontrib.yml index aeb9d028..9d3637bc 100644 --- a/.github/workflows/geocontrib.yml +++ b/.github/workflows/geocontrib.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v1 - name: "Building docker image" working-directory: docker - run: docker-compose -f docker-compose.geocontrib-alone.yaml build + run: docker-compose build - name: "Getting image tag" id: version run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) diff --git a/.gitignore b/.gitignore index 5f2ebac9..1346d926 100644 --- a/.gitignore +++ b/.gitignore @@ -97,4 +97,6 @@ config/__init__.py /docker/nginx/conf.d/geocontrib.conf # MacOS -.DS_Store \ No newline at end of file +.DS_Store + +docker/docker-compose.override.yaml diff --git a/docker/docker-compose.geocontrib-alone.yaml b/docker/docker-compose.yaml similarity index 100% rename from docker/docker-compose.geocontrib-alone.yaml rename to docker/docker-compose.yaml From 4896cfcf0aa4265fbfac4c171a2dde4b506efed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= Date: Thu, 14 Jan 2021 15:03:00 +0100 Subject: [PATCH 04/27] =?UTF-8?q?Fix=20#9926=20Impossible=20de=20cr=C3=A9e?= =?UTF-8?q?r=202=20signalements=20(#88)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- geocontrib/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geocontrib/models.py b/geocontrib/models.py index 16b1d383..7412a745 100644 --- a/geocontrib/models.py +++ b/geocontrib/models.py @@ -335,7 +335,7 @@ def clean(self): raise ValidationError('Format de donnée invalide') def save(self, *args, **kwargs): - if self.pk is None: + if self._state.adding: self.created_on = timezone.now() self.updated_on = timezone.now() super().save(*args, **kwargs) From 7357e458e773a3747f9b529519f32ab2d9c94671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= Date: Thu, 14 Jan 2021 16:57:21 +0100 Subject: [PATCH 05/27] Change #9754 Docker: can overide login URL (#89) --- docker/geocontrib/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/geocontrib/settings.py b/docker/geocontrib/settings.py index 0d102fe9..2cb12d9f 100644 --- a/docker/geocontrib/settings.py +++ b/docker/geocontrib/settings.py @@ -122,7 +122,7 @@ # Extended properties AUTH_USER_MODEL = 'geocontrib.User' -LOGIN_URL = 'geocontrib:login' +LOGIN_URL = config("LOGIN_URL", default='geocontrib:login') LOGIN_REDIRECT_URL = 'geocontrib:index' LOGOUT_REDIRECT_URL = 'geocontrib:index' From ada5f784f1d9f8e7b3f6a1edd98390be800bd512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= Date: Thu, 14 Jan 2021 17:41:42 +0100 Subject: [PATCH 06/27] Fix #9929 Map icons missing (#90) --- .../leaflet-draw-1.0.4/images/layers-2x.png | Bin 0 -> 1259 bytes .../leaflet-draw-1.0.4/images/layers.png | Bin 0 -> 696 bytes .../images/marker-icon-2x.png | Bin 0 -> 2586 bytes .../leaflet-draw-1.0.4/images/marker-icon.png | Bin 0 -> 1466 bytes .../images/marker-shadow.png | Bin 0 -> 618 bytes .../images/spritesheet-2x.png | Bin 0 -> 3581 bytes .../leaflet-draw-1.0.4/images/spritesheet.png | Bin 0 -> 1906 bytes .../leaflet-draw-1.0.4/images/spritesheet.svg | 156 ++++++++++++++++++ 8 files changed, 156 insertions(+) create mode 100644 geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/layers-2x.png create mode 100644 geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/layers.png create mode 100644 geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/marker-icon-2x.png create mode 100644 geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/marker-icon.png create mode 100644 geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/marker-shadow.png create mode 100644 geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/spritesheet-2x.png create mode 100644 geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/spritesheet.png create mode 100644 geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/spritesheet.svg diff --git a/geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/layers-2x.png b/geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/layers-2x.png new file mode 100644 index 0000000000000000000000000000000000000000..200c333dca9652ac4cba004d609e5af4eee168c1 GIT binary patch literal 1259 zcmVFhCYNy;#0irRPomHqW|G1C*;4?@4#E?jH>?v@U%cy?3dQAc-DchXVErpOh~ z-jbon+tNbnl6hoEb;)TVk+%hTDDi_G%i3*RZ&15!$Fjr^f;Ke&A@|?=`2&+{zr+3a z{D*=t(`AXyS%X7N z%a#RZw6vD^t_rnM`L4E>m=U&R!A-&}nZIi$BOPvkhrCuUe@BN~-lRD)f44;J%TwgE zcze8u!PQ_NR7?o(NylLXVTfDO zxs5=@|GsYEsNo4M#nT%N!UE(?dnS)t2+{ELYAFp*3=iF=|EQnTp`#vlSXuGVraYo? z+RCzXo6h3qA8{KG?S4nE(lM+;Eb4nT3XV;7gcAxUi5m)`k5tv}cPy()8ZR3TLW3I- zAS^}cq-IJvL7a4RgR!yk@~RT%$lA7{L5ES*hyx)M4(yxI$Ub(4f)K|^v1>zvwQY!_ zIrWw8q9GS^!Dp~}+?mbnB6jDF8mVlbQ!jFKDY;w=7;XO{9bq7>LXGK24WA`;rL)_Z z)&j}pbV(;6gY;VMhbxgvn`X;6x}VUEE-7 z%)7j-%t8S=ZL3yc)HbXDAqJZvBTPoiW_A-+a8m3_Z?v{DN7Tnr#O_VUMT0UBt$;p` zDh6JbGHN8JJ*JN%y2%msb97@_S>9!%Egwk;?PEkU9ntz&3uR}%Fj5d$JHQbQb3}a{ zSzFT^#n=VInPpcAS}CNxj?_ zVscANk5Cfz(51EI1pz};AWWb|kgbYNb4wCEGUn3+eMUMV?1-{=I4TlmLJMot@rd07 zZuo2hk1ccu{YmGkcYdWAVdk{Z4Nm?^cTD&}jGm+Q1SYIXMwmG*oO*83&#>l%nbR`G zhh=lZ%xIb7kU3#;TBbfECrnC9P=-XpL|TG2BoZdj61*XiFbW8?1Z_wp%#;>${SUIy V$8qr;L*)Pf002ovPDHLkV1hYLS~36t literal 0 HcmV?d00001 diff --git a/geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/layers.png b/geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/layers.png new file mode 100644 index 0000000000000000000000000000000000000000..1a72e5784b2b456eac5d7670738db80697af3377 GIT binary patch literal 696 zcmV;p0!RIcP)*@&l2<6p=!C&s@#ZL+%BQvF&b?w6S%wp=I>1QHj7AP5C)IWy#b znXXB;g;j=$a-tW89K%FbDceHVq&unY*Wx3L#=EGWH=rjqnp|4c_Ulec!ql3#G-5ZF zVlbBA@XP=)C8U&+Lrc)S4O5%1$&{(;7R^K(CSnvSr$v;+B$8q&7Bf|h$#PARo1^%M zf1H^nG-EiXVXr07OH(*8R)xa|FD;lXUlg_-%)~ZGsL2cX0NXaAzN2q%jqLRR6ruVk8`Jb7n#{`T;o@`F= z#3YcynIR^s83UNF3D!f5m#Mg)NJ24&Qfrqb&_z=yF;=B)#9Iq7u-@^O!(mW{D;qvr zPc)gVb%aowtS8m@ElL4A9G>w#ffQ~q{i&_i)*6f^)Sz|C?C>zb4Uo?H<-&Hz@a?J; z$ml@zGygWofb9$ZBj6aLjpLhsT2AzjOu=-*u_gSCULuqp7Vds@BKcX=lOk~^Pb;%&wG9p3o}FL;Zuhp5D3)R z2yY2yCGfH2=LJmOkQw^9n>daF6?Fz>oOD64$CM+_T`j0x%{zb|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yz*bJ!*A&^rr((=SaeGlUNwV z01+e{DcnsPPIth+gTfMc34NrqGRM-T5f0=)<0vZ6?K`I0Z1Y3GdqxI|$iyh%qoeNX UQO-*oc+)|Q_08}VdXD6O0C*xx%>V!Z literal 0 HcmV?d00001 diff --git a/geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/marker-icon.png b/geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/marker-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..950edf24677ded147df13b26f91baa2b0fa70513 GIT binary patch literal 1466 zcmV;r1x5OaP)P001cn1^@s6z>|W`000GnNklGNuHDcIX17Zdjl&3`L?0sTjIws<{((Dh&g-s0<@jYQyl?D*X^?%13;ml^gy> ziMrY_^1WI=(g@LMizu=zCoA>C`6|QEq1eV92k*7m>G65*&@&6)aC&e}G zI)pf-Za|N`DT&Cn1J|o`19mumxW~hiKiKyc-P`S@q)rdTo84@QI@;0yXrG%9uhI>A zG5QHb6s4=<6xy{1 z@NMxEkryp{LS44%z$3lP^cX!9+2-;CTt3wM4(k*#C{aiIiLuB>jJj;KPhPzIC00bL zU3a#;aJld94lCW=`4&aAy8M7PY=HQ>O%$YEP4c4UY#CRxfgbE~(|uiI=YS8q;O9y6 zmIkXzR`}p7ti|PrM3a}WMnR=3NVnWdAAR>b9X@)DKL6=YsvmH%?I24wdq?Gh54_;# z$?_LvgjEdspdQlft#4CQ z`2Zyvy?*)N1Ftw|{_hakhG9WjS?Az@I@+IZ8JbWewR!XUK4&6346+d#~gsE0SY(LX8&JfY>Aj)RxGy96nwhs2rv zzW6pTnMpFkDSkT*a*6Dx|u@ds6ISVn0@^RmIsKZ5Y;bazbc;tTSq(kg(=481ODrPyNB6n z-$+U}(w$m6U6H$w17Bw+wDaFIe~GvNMYvnw31MpY0eQKT9l>SU``8k7w4)z!GZKMI z#_cEKq7k~i%nlK@6c-K?+R;B#5$?T#YpKD`t_4bAs^#E+@5QW$@OX3*`;(#{U^d-vY)&xEE>n5lYl&T?Amke9$Lam@{1K@O ze*LXqlKQHiv=gx+V^Cbb2?z@ISBQ*3amF;9UJ3SBg(N|710TLamQmYZ&Qjn2LuO<* zCZlB4n%@pc&7NNnY1}x+NWpHlq`OJEo|`aYN9<`RBUB+79g;>dgb6YlfN#kGL?lO_ z!6~M^7sOnbsUkKk<@Ysie&`G>ruxH&Mgy&8;i=A zB9OO!xR{AyODw>DS-q5YM{0ExFEAzt zm>RdS+ssW(-8|?xr0(?$vBVB*%(xDLtq3Hf0I5yFm<_g=W2`QWAax{1rWVH=I!VrP zs(rTFX@W#t$hXNvbgX`gK&^w_YD;CQ!B@e0QbLIWaKAXQe2-kkloo;{iF#6}z!4=W zi$giRj1{ zt;2w`VSCF#WE&*ev7jpsC=6175@(~nTE2;7M-L((0bH@yG}-TB$R~WXd?tA$s3|%y zA`9$sA(>F%J3ioz<-LJl*^o1|w84l>HBR`>3l9c8$5Xr@xCiIQ7{x$fMCzOk_-M=% z+{a_Q#;42`#KfUte@$NT77uaTz?b-fBe)1s5XE$yA79fm?KqM^VgLXD07*qoM6N<$ Ef<_J(9smFU literal 0 HcmV?d00001 diff --git a/geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/spritesheet-2x.png b/geocontrib/static/geocontrib/resources/leaflet-draw-1.0.4/images/spritesheet-2x.png new file mode 100644 index 0000000000000000000000000000000000000000..c45231aff86b1344333414cdfa7a2a74d38d5304 GIT binary patch literal 3581 zcmb_f`#;nBAOB2clxyUYb<>4Ynk1K8OH(Z&mzm3$Tyx3X$HJB_R+xiO7)ip%jA&_M zl!g=0DI?9L49i_)E<@k-{pI@)d|!{p`}%mjuaEcZ`Fy_bU9q_!y?ys~005+s7ZLUV zAm%Kpn@EU@^7{ODOi{5l!UE|iA+k6LAF`+|8G6wrLge4~CqXPU^I}Aus*#q?kq$V& zNc`1sUjUEC!vjKsBD}AL`oeMH{&}+|yG7mvB;u@NO#aLuF$Lxy3!R_SjbJ6a7tRHv zBz1~*mIVgf1VOjVip+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&e{Ld(%d-`&j|a|4(L^E^+csfMgU~=v&b-S#u zudmR(Iq2qsS45tW+~pasy_~(gwzkGDEiENAPH9TgYTR28V$BxX8nc^wOf4;U9y~>R z=_cYoV~U4^X$~Ghm30w3SbBPl>WTiHVD#iOn_Aw7-7~XdSf_VAR{)g66#YCQJ%5%~ i{eP_FzxHA`84t@4c6%tZ%} + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From e8c1b410264a3c28e14ecc2561ecf1af1171d8ed Mon Sep 17 00:00:00 2001 From: chakibBH Date: Thu, 21 Jan 2021 10:14:39 +0100 Subject: [PATCH 07/27] feat 9834 ldap pagination (#91) feat 9834 ldap pagination --- .../management/commands/georchestra_user_sync.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugin_georchestra/management/commands/georchestra_user_sync.py b/plugin_georchestra/management/commands/georchestra_user_sync.py index 3038840c..72749a36 100644 --- a/plugin_georchestra/management/commands/georchestra_user_sync.py +++ b/plugin_georchestra/management/commands/georchestra_user_sync.py @@ -1,7 +1,6 @@ from argparse import RawTextHelpFormatter from collections import Counter import itertools -import json import logging import re @@ -75,12 +74,15 @@ def create_parser(self, *args, **kwargs): return parser def search_ldap(self, connection): - connection.search( + entries = [] + entry_generator = connection.extend.standard.paged_search( search_base=LDAP_SEARCH_BASE, search_filter=LDAP_SEARCH_FILTER, - attributes=[ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES]) - - return [json.loads(data.entry_to_json()).get('attributes', {}) for data in connection.entries] + attributes=[ALL_ATTRIBUTES, ALL_OPERATIONAL_ATTRIBUTES], + paged_size=200, generator=True) + for entry in entry_generator: + entries.append(entry.get('attributes', {})) + return entries def get_remote_data(self): # récupérer les données remote depuis ce serveur et mapper les données From 8b4ba58eff905a3e8833f2cab8461aa39fb8e7e3 Mon Sep 17 00:00:00 2001 From: chakibBH Date: Tue, 26 Jan 2021 08:51:11 +0100 Subject: [PATCH 08/27] fix/9985: Postgres view Feature Fields choices (#92) --- geocontrib/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geocontrib/forms.py b/geocontrib/forms.py index 5d49cf98..4f5f7e6a 100644 --- a/geocontrib/forms.py +++ b/geocontrib/forms.py @@ -81,7 +81,7 @@ class FeatureSelectFieldAdminForm(forms.Form): label="Champs à ajouter", choices=[( str(field.name), "{0} - {1}".format(field.name, field.get_internal_type()) - ) for field in Feature._meta.get_fields()], + ) for field in Feature._meta.get_fields(include_parents=False) if field.concrete is True], required=False ) alias = forms.CharField( From 5aa32e470faa1fc68d2e62bcc10628f62b0e65c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= Date: Tue, 26 Jan 2021 08:53:55 +0100 Subject: [PATCH 09/27] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4e0626e..1d93b197 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Docker, give default values for email configuration +- Redmine 9985: fix PostgreSQL view creation of a feature when adding/removing custom fields ## [1.2.0] - 2020-12-17 From 38f99742242cfc36ce73684cb40589e08cd06f7a Mon Sep 17 00:00:00 2001 From: cbenhabib Date: Mon, 25 Jan 2021 17:35:45 +0100 Subject: [PATCH 10/27] fix 9986 Postgres view Status selection --- geocontrib/admin/feature.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/geocontrib/admin/feature.py b/geocontrib/admin/feature.py index 5f530362..bf520472 100644 --- a/geocontrib/admin/feature.py +++ b/geocontrib/admin/feature.py @@ -124,11 +124,10 @@ def create_postgres_view(self, request, feature_type_id, *args, **kwargs): request.POST or None, prefix='fds', initial=feature_detail_initial) cfs_formset = CustomFieldsFormSet(request.POST or None, prefix='cfs') - pg_form = AddPosgresViewAdminForm(request.POST or None) if fds_formset.is_valid() and pg_form.is_valid() and cfs_formset.is_valid(): view_name = pg_form.cleaned_data.get('name') - + status = pg_form.cleaned_data.get('status') or (stat[0] for stat in Feature.STATUS_CHOICES) fds_data = self.pop_deleted_forms(fds_formset.cleaned_data) cfs_data = self.pop_deleted_forms(cfs_formset.cleaned_data) @@ -138,7 +137,7 @@ def create_postgres_view(self, request, feature_type_id, *args, **kwargs): fds_data=fds_data, cfs_data=cfs_data, feature_type_id=feature_type_id, - status=pg_form.cleaned_data.get('status'), + status=status, schema=getattr(settings, 'DB_SCHEMA', 'public'), view_name=view_name, user=settings.DATABASES['default']['USER'], From 7d5252946ead8ab1463864fae52032259299a9d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= Date: Tue, 26 Jan 2021 08:58:38 +0100 Subject: [PATCH 11/27] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d93b197..4dc2eb64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Docker, give default values for email configuration - Redmine 9985: fix PostgreSQL view creation of a feature when adding/removing custom fields +- Redminefix 9986 fix Postgres view creation when no status selected ## [1.2.0] - 2020-12-17 From 4e6e739304265c55838690438ebbbcedfe4f9a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= Date: Thu, 28 Jan 2021 16:42:07 +0100 Subject: [PATCH 12/27] #9557 document periodic tasks --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 5f334cb2..b2495cd2 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,21 @@ python manage.py runserver Se rendre dans l'interface d'administration Django et éditer le premier enregistrement des entités "Sites" (cf. yoururl.net/admin/sites/). +## Configuration des tâches périodiques + +Deux types de tâches requièrent d'invoquer une commande régulièrement (depuis un cron par exemple) + +L'envoi de mails de norifications, vous pouvez l'appeler toutes les minutes ou tous les jours selon vos préférences d'envoi +```shell +python manage.py notify_subscribers +``` + +L'archivage et la suppression des signalements, à invoquer une fois par jour +```shell +python manage.py data_cleansing +``` + + ## Déploiement dans un environnement geOrchestra Reportez-vous au README.md présent dans le répertoire `plugin_georchestra`. From 6abbecc4c5049ac8382ef79968db91c5ccdd5a82 Mon Sep 17 00:00:00 2001 From: cbenhabib Date: Thu, 28 Jan 2021 15:41:03 +0100 Subject: [PATCH 13/27] fix 9846: FeatureLink cleansing + remove remaining feature uuid instances from old FeatureLink model --- geocontrib/management/commands/data_cleansing.py | 16 ++++++++++++++-- geocontrib/migrations/0008_auto_20201208_0911.py | 8 +++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/geocontrib/management/commands/data_cleansing.py b/geocontrib/management/commands/data_cleansing.py index 636ac506..cb46be6f 100644 --- a/geocontrib/management/commands/data_cleansing.py +++ b/geocontrib/management/commands/data_cleansing.py @@ -1,4 +1,5 @@ from django.core.management.base import BaseCommand +from django.db import connections from django.db.models import Q from django.utils import timezone @@ -16,9 +17,9 @@ class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument( - dest='task_name', type=str, choices=['all', 'delete_feature', 'archive_feature'], + dest='task_name', type=str, choices=['all', 'delete_feature', 'archive_feature', 'clean_feature_link'], help="""Nom de la tache à executer et à choisir parmi: - 'all', 'delete_feature', 'archive_feature' """ + 'all', 'delete_feature', 'archive_feature', 'clean_feature_link' """ ) def delete_feature(self): @@ -56,6 +57,15 @@ def archive_feature(self): logger.info('Feature {0} archived'.format(feature.feature_id)) logger.info('NB archived features: {}'.format(nb_features)) + def feature_link(self): + # Facilite la migration 0008_auto + # le signal post_delete de FeatureLink + # étant bloquant on passe par du raw sql + with connections['default'].cursor() as cursor: + for field in ['feature_from', 'feature_to']: + sql = "DELETE FROM geocontrib_featurelink WHERE {} not in (SELECT feature_id FROM geocontrib_feature)".format(field) + cursor.execute(sql) + def handle(self, *args, **options): tasks = options['task_name'] if 'all' not in tasks: @@ -63,6 +73,8 @@ def handle(self, *args, **options): self.delete_feature() if 'archive_feature' in tasks: self.archive_feature() + if 'clean_feature_link' in tasks: + self.feature_link() else: self.delete_feature() self.archive_feature() diff --git a/geocontrib/migrations/0008_auto_20201208_0911.py b/geocontrib/migrations/0008_auto_20201208_0911.py index 82bb4b11..ad8c0dc4 100644 --- a/geocontrib/migrations/0008_auto_20201208_0911.py +++ b/geocontrib/migrations/0008_auto_20201208_0911.py @@ -4,13 +4,19 @@ import django.db.models.deletion +def clean_deleted_feature_links(apps, schema_editor, elidible=True): + from django.core.management import call_command + call_command('data_cleansing', 'clean_feature_link') + + class Migration(migrations.Migration): dependencies = [ - ('geocontrib', '0007_auto_20200729_0916'), + ('geocontrib', '0008_project_is_project_type'), ] operations = [ + migrations.RunPython(clean_deleted_feature_links, elidable=True), migrations.AlterModelOptions( name='featurelink', options={'verbose_name': 'Liaison entre signalements', 'verbose_name_plural': 'Liaisons entre signalements'}, From 7b14b802e355bb49790f472b4a0eed4ed4316e7c Mon Sep 17 00:00:00 2001 From: cbenhabib Date: Tue, 26 Jan 2021 11:10:44 +0100 Subject: [PATCH 14/27] fix 9848 filter admin FeatureLink --- geocontrib/admin/feature.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/geocontrib/admin/feature.py b/geocontrib/admin/feature.py index bf520472..8d63003a 100644 --- a/geocontrib/admin/feature.py +++ b/geocontrib/admin/feature.py @@ -3,7 +3,6 @@ from django.conf import settings from django.contrib import messages from django.contrib.auth import get_user_model -from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin from django.contrib.gis import admin from django.db import connections from django.forms import formset_factory @@ -11,7 +10,6 @@ from django.shortcuts import redirect from django.template.response import TemplateResponse from django.urls import path -from django.utils.translation import ugettext_lazy as _ from django.template.loader import render_to_string from geocontrib.admin.filters import FeatureTypeFilter @@ -22,6 +20,7 @@ from geocontrib.forms import HiddenDeleteModelFormSet from geocontrib.forms import FeatureSelectFieldAdminForm from geocontrib.forms import AddPosgresViewAdminForm +from geocontrib.models import Authorization from geocontrib.models import Feature from geocontrib.models import FeatureType from geocontrib.models import FeatureLink @@ -196,10 +195,19 @@ class FeatureLinkAdmin(admin.ModelAdmin): '_feature_to', 'get_feature_type', ) - # ordering = ('_feature_from', ) list_per_page = 10 + def get_queryset(self, request): + user = request.user + qs = super().get_queryset(request) + if user.is_superuser: + return qs + moderation_projects_pk = Authorization.objects.filter( + user=user, level__rank__gte=3 + ).values_list('project__pk', flat=True) + return qs.filter(feature_to__project__in=moderation_projects_pk) + def get_readonly_fields(self, request, obj=None): if obj: return self.readonly_fields + ('relation_type', 'feature_from', 'feature_to') From 5b3c103e0503887bf324da545ef037b95d47d466 Mon Sep 17 00:00:00 2001 From: e-babani <37336064+e-babani@users.noreply.github.com> Date: Fri, 29 Jan 2021 12:02:55 +0100 Subject: [PATCH 15/27] Update index.md --- docs/index.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/index.md b/docs/index.md index e67916d1..d0d5fb27 100644 --- a/docs/index.md +++ b/docs/index.md @@ -106,11 +106,13 @@ La page d'accueil de l'application contient : s'authentifier, * si un utilisateur est connecté : le nom de l'utilisateur courant et un bouton de déconnexion. Un clic sur le nom de l'utilisateur renvoie vers sa page "Mon compte" +* un bouton de création d'un nouveau projet (présent uniquement pour les utilisateurs ayant le rôle de Gestionnaire +métier); +* un bouton permettant à la liste des modèles de projet (présent uniquement pour les utilisateurs ayant le rôle de Gestionnaire métier); * la liste des projets existants avec une courte description et quelques indicateurs. Un clic sur un projet renvoie vers la page d'accueil de ce projet si l'utilisateur courant est habilité à le consulter. Dans le cas contraire un -message d'erreur lui est présenté ; -* un bouton de création d'un nouveau projet (présent uniquement pour les utilisateurs ayant le rôle de Gestionnaire -métier). +message d'erreur lui est présenté. + ### Menu d'un projet @@ -195,7 +197,7 @@ page) : * une vue tabulaire paginée : * tri par ordre chronologique inverse (les signalements les plus récents sont affichés en premier), * présentation des caractéristiques principales : statut (représenté par un pictogramme), type de signalements, titre, - et date de dernière modification, + date de dernière modification, et auteur du signalement, * le clic sur le titre renvoie vers la fiche détaillée du signalement, * le clic sur le type de signalements renvoie vers la fiche détaillée du signalement. @@ -203,7 +205,7 @@ Chacune d'entre elles propose un bloc "Filtres" permettant à l'utilisateur de r qu'il recherche : * filtre sur le type de signalements ; * filtre sur le statut des signalements ; -* filtre textuel recherchant la chaîne de caractères saisie par l'utilisateur dans le titre des signalements +* filtre textuel recherchant la chaîne de caractères saisie par l'utilisateur dans le titre des signalements. ### Page de consultation d'un signalement From 45da88c4721cd63d5a0529408926c5cbafee5328 Mon Sep 17 00:00:00 2001 From: e-babani <37336064+e-babani@users.noreply.github.com> Date: Fri, 29 Jan 2021 12:26:58 +0100 Subject: [PATCH 16/27] Update import-export.md --- docs/import-export.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/import-export.md b/docs/import-export.md index a242c1a6..292ca70e 100644 --- a/docs/import-export.md +++ b/docs/import-export.md @@ -16,16 +16,19 @@ droits supérieurs du projet) * Création de nouveaux signalements * La fonction n'est pas capable de mettre à jour des signalements existants ni de supprimer des signalements existants * Les enregistrements soupçonnés de former des doublons sont marqués automatiquement à l'aide du mécanisme de relation -entre signalements. Les doublons sont identifiés par l'égalité de leur titre et de leur description) +entre signalements. Les doublons sont identifiés par l'égalité de leur titre et de leur description, ou par l'égalité de leur géométrie) * Les enregistrements importés sont enregistrés avec le statut "brouillon" **Contraintes** : * Le modèle de données supporté par la fonction d'import est décrit dans la page descriptive du type de signalements * Seuls les champs portant les mêmes noms que la table des signalements en base sont exploités +* Des champs supplémentaires doivent être ajoutés au fichier Json ('title' champs unique, 'feature_type' slug du type de signalement) * Pour les champs correspondant à des listes de choix : seules les valeurs seront exploitées (pas les libellés en langage naturel) * Géométries supportées pour Excel : colonne geom en WKT dans le système de coordonnées attendu (pas de reprojection - cf. DB_SRID dans settings.py) +* La projection doit être du 4326 +* Les types "multi" (multiPolygon, multiLigne) ne sont pas exploitables. ## Export From 3123e3db43e0fb3a79e25d1bbb7a1f854db4f126 Mon Sep 17 00:00:00 2001 From: e-babani <37336064+e-babani@users.noreply.github.com> Date: Fri, 29 Jan 2021 16:44:52 +0100 Subject: [PATCH 17/27] Create project_template.md --- docs/project_template.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 docs/project_template.md diff --git a/docs/project_template.md b/docs/project_template.md new file mode 100644 index 00000000..68f6188a --- /dev/null +++ b/docs/project_template.md @@ -0,0 +1,16 @@ +# Modèle de projet + +## Utiliser un modèle de projet pour créer un nouveau projet + +Lors de la création d'un nouveau projet, les administrateurs ou les gestionnaires métiers ont la possibilité d'utiliser un modèle. +Depuis la page d'accueil de l'application, un bouton "Accéder à la liste des modèles de projet" placé sur le haut de page, à droite, permet d'accéder à la liste des projets déclarés comme modèles. +Au clic sur un des projets modèles listés, la page de création d'un nouveau projet est proposée à l'utilisateur. Les champs caractéristiques du nouveau projet sont pré-remplis avec les mêmes valeurs que celles du projet modèle. Les champs sont tous éditables. +Par défaut, le même titre que celui du projet modèle est proposé, suivi de la date / heure de la copie du projet modèle. + +## Enregistrer un projet comme modèle + +Depuis l'application Géocontrib, dans la page de configuration d'un projet, accessible aux administrateurs et aux gestionnaires métier, une case à cocher placée en bas de la page permet de considérer le projet comme modèle. +Après l'enregistrement, ce projet sera disponible dans la liste des modèles de projet. + +Depuis le Back Office de Django, depuis les pages "projets", les gestionnaires métiers et super-utilisateurs ont la possibilité de cocher la case "Est un projet type" pour définir le projet comme étant un modèle. + From f2ee4eecba8663cad1e65132ddcedaa5924960ec Mon Sep 17 00:00:00 2001 From: cbenhabib Date: Mon, 1 Feb 2021 16:26:13 +0100 Subject: [PATCH 18/27] fix 10142 --- geocontrib/managers.py | 17 +++++- .../geocontrib/feature/feature_detail.html | 12 ++-- geocontrib/views/content_managment.py | 55 +++++++++---------- 3 files changed, 46 insertions(+), 38 deletions(-) diff --git a/geocontrib/managers.py b/geocontrib/managers.py index 6f89c637..dd9d95b0 100644 --- a/geocontrib/managers.py +++ b/geocontrib/managers.py @@ -7,7 +7,11 @@ class AvailableFeaturesManager(models.Manager): def get_queryset(self): - return super().get_queryset() + queryset = super().get_queryset() + queryset = queryset.select_related('creator') + queryset = queryset.select_related('feature_type') + queryset = queryset.select_related('project') + return queryset def availables(self, user, project): Authorization = apps.get_model(app_label='geocontrib', model_name='Authorization') @@ -70,7 +74,10 @@ def project_filter(self, project): class FeatureLinkManager(models.Manager): def get_queryset(self): - return super().get_queryset() + queryset = super().get_queryset() + queryset = queryset.select_related('feature_from') + queryset = queryset.select_related('feature_to') + return queryset def context(self, feature_id): res = self.get_queryset().filter( @@ -88,3 +95,9 @@ def context(self, feature_id): ) ).values_list('relation_display', 'relation_type') return res + + def related(self, feature_id): + queryset = self.get_queryset().filter( + Q(feature_from__feature_id=feature_id) | Q(feature_to__feature_id=feature_id) + ) + return queryset diff --git a/geocontrib/templates/geocontrib/feature/feature_detail.html b/geocontrib/templates/geocontrib/feature/feature_detail.html index 67dfa1ef..2f30de5c 100644 --- a/geocontrib/templates/geocontrib/feature/feature_detail.html +++ b/geocontrib/templates/geocontrib/feature/feature_detail.html @@ -15,12 +15,12 @@

{% if permissions|lookup:'can_create_feature' %} {# @@ -211,7 +211,7 @@

Activité et commentaires

{% if permissions|lookup:'can_create_feature' %}
-
+ {% for hidden in comment_form.hidden_fields %} {{ hidden }} {% endfor %} @@ -259,7 +259,7 @@

Activité et commentaires

Supprimer le signalement
- + {% csrf_token %}