Skip to content

Commit

Permalink
Follow up previous commit about non existing PK
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Nov 6, 2023
1 parent cd9bc41 commit fd3b51d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lizmap/project_checker_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,12 @@ def invalid_int8_primary_key(layer: QgsVectorLayer) -> bool:
if not primary_key:
return False

field = layer.fields().field(primary_key)

if not field:
if primary_key not in layer.fields().names():
# The primary key used in the datasource doesn't exist in the proper layer fields
# We don't check, because this test is done in "auto_generated_primary_key_field"
return False

field = layer.fields().field(primary_key)
return field.typeName().lower() == 'int8'


Expand Down

0 comments on commit fd3b51d

Please sign in to comment.