From 3301c1395d60ed01aafc1a2ba806844dcf5ca2ca Mon Sep 17 00:00:00 2001
From: Tom LAVEILLE
Date: Wed, 22 Jan 2025 07:39:57 +0100
Subject: [PATCH] =?UTF-8?q?Block=20la=20cr=C3=A9ation=20de=20shema=20sans?=
=?UTF-8?q?=20table?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
CenRa_POSTGIS/metadata.txt | 4 ++--
CenRa_POSTGIS/postgis_creator.py | 9 ++++++---
plugins.xml | 6 +++---
3 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/CenRa_POSTGIS/metadata.txt b/CenRa_POSTGIS/metadata.txt
index 596b5449..00e41a9e 100644
--- a/CenRa_POSTGIS/metadata.txt
+++ b/CenRa_POSTGIS/metadata.txt
@@ -12,7 +12,7 @@
name=CenRa_POSTGIS
qgisMinimumVersion=3.0
description=Permet de crée un dossier dans la base PostGis
-version=2.2
+version=2.3
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
email=si_besoin@cen-rhonealpes.fr
@@ -21,7 +21,7 @@ email=si_besoin@cen-rhonealpes.fr
# Optional items:
# Uncomment the following line and add your changelog entries:
-changelog=CenRa_POSTGIS:
21/01/2025 - Version 2.2:
- Correctif sur la longeur des nom.
07/01/2025 - Version 2.1:
- ByPass du certif ssl ci erreur.22/10/2024 - Version 2.0:
- Refont du code.
+changelog=CenRa_POSTGIS:
22/01/2025 - Version 2.3:
- Correctif sur la creation de projet.21/01/2025 - Version 2.2:
- Correctif sur la longeur des nom.07/01/2025 - Version 2.1:
- ByPass du certif ssl ci erreur.22/10/2024 - Version 2.0:
- Refont du code.
# tags are comma separated with spaces allowed
tags=cenra, postgis, database
diff --git a/CenRa_POSTGIS/postgis_creator.py b/CenRa_POSTGIS/postgis_creator.py
index 08c72d72..f5b85738 100644
--- a/CenRa_POSTGIS/postgis_creator.py
+++ b/CenRa_POSTGIS/postgis_creator.py
@@ -7,7 +7,7 @@ from builtins import str
from builtins import object
import qgis
from qgis.PyQt.QtCore import QSettings
-from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog
+from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog,QMessageBox
from qgis.PyQt.QtGui import QIcon
from PyQt5.QtCore import *
from PyQt5.QtGui import *
@@ -83,8 +83,11 @@ class Postgis_Creator(QDialog, EDITOR_CLASS):
SQL_schema = "CREATE SCHEMA " + schema + ";"
SQL_GRANT_SCHEMA="GRANT CREATE, USAGE ON SCHEMA "+schema+" TO grp_qgis; GRANT CREATE, USAGE ON SCHEMA "+schema+" TO grp_sig;"
- cur.execute(SQL_schema)
- cur.execute(SQL_GRANT_SCHEMA)
+ if self.couche_contour.isChecked() or self.couche_habitat.isChecked() or self.couche_travaux_prevus.isChecked() or self.couche_vierge.isChecked():
+ cur.execute(SQL_schema)
+ cur.execute(SQL_GRANT_SCHEMA)
+ else:
+ iface.messageBar().pushMessage("POSTGRESQL :", "Pas de couche sélectionnée, création refusée.", level=Qgis.Warning, duration=30)
### Creation de la table contour
if self.couche_contour.isChecked(): # Verifie si la checkbox est cochee
diff --git a/plugins.xml b/plugins.xml
index 39da68ac..b5c9690e 100644
--- a/plugins.xml
+++ b/plugins.xml
@@ -1,8 +1,8 @@
-
+
- 2.2
+ 2.3
3.16
https://plateformesig.cenra-outils.org/
CenRa_POSTGIS.zip
@@ -11,7 +11,7 @@
https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_POSTGIS.zip
CEN-Rhone-Alpes
2024-02-06
- 2025-01-21
+ 2025-01-22
False
False
cenra,postgis