diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f134f99..7e5ab92 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # Fix end of files - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -11,7 +11,7 @@ repos: # Remove unused imports/variables - repo: https://github.com/myint/autoflake - rev: v1.4 + rev: v2.0.1 hooks: - id: autoflake args: @@ -22,7 +22,7 @@ repos: # Sort imports - repo: https://github.com/pycqa/isort - rev: "5.7.0" + rev: "5.12.0" hooks: - id: isort args: @@ -31,7 +31,7 @@ repos: # Black formatting - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 23.1.0 hooks: - id: black language_version: python3 diff --git a/linking_relation_editor/gui/linking_relation_editor_widget.py b/linking_relation_editor/gui/linking_relation_editor_widget.py index 1660931..ee1eb50 100644 --- a/linking_relation_editor/gui/linking_relation_editor_widget.py +++ b/linking_relation_editor/gui/linking_relation_editor_widget.py @@ -365,7 +365,6 @@ def parentFormValueChanged(self, attribute, newValue): QgsMessageLog.logMessage("parentFormValueChanged()") def updateUiSingleEdit(self): - self.mFormViewButton.setVisible(not self.mOneToOne) self.mTableViewButton.setVisible(not self.mOneToOne) self.mMultiEditInfoLabel.setVisible(False) @@ -542,7 +541,6 @@ def duplicateSelectedFeatures(self): self.duplicateFeatures(self.mFeatureSelectionMgr.selectedFeatureIds()) def _execLinkFeatureDialog(self): - layer = None if self.nmRelation().isValid(): @@ -568,7 +566,6 @@ def _execLinkFeatureDialog(self): relationEditorLinkChildManagerDialog.show() def _linkFeatures(self, featureIds): - if len(featureIds) == 0: return @@ -585,9 +582,8 @@ def _linkFeatures(self, featureIds): polyRel = self.relation().polymorphicRelation() assert polyRel.isValid() - linkAttributes.insert( - fields.indexFromName(polyRel.referencedLayerField()), - polyRel.layerRepresentation(self.relation().referencedLayer()), + linkAttributes[fields.indexFromName(polyRel.referencedLayerField())] = polyRel.layerRepresentation( + self.relation().referencedLayer() ) linkFeatureDataList = [] @@ -754,7 +750,6 @@ def afterSetRelations(self): self.updateButtons() def _checkTransactionGroup(self): - self._layerInSameTransactionGroup = False connectionString = PluginHelper.connectionString(self.relation().referencedLayer().source()) transactionGroup = QgsProject.instance().transactionGroup(