Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid warning people that a read-only layer will be read-only on the cloud #57

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions libqfieldsync/project_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,15 @@ def check_layer_primary_key(
):
return None

try:
layer_source.get_pk_attr_name()
except UnsupportedPrimaryKeyError as err:
suffix = self.tr(
"The layer will be packaged **as a read-only layer on QFieldCloud**. "
"Geopackages are [the recommended data format for QFieldCloud](https://docs.qfield.org/get-started/tutorials/get-started-qfc/#configure-your-project-layers-for-qfield). "
)
return FeedbackResult(f"{str(err)} {suffix}")
if not layer.readOnly():
try:
layer_source.get_pk_attr_name()
except UnsupportedPrimaryKeyError as err:
suffix = self.tr(
"The layer will be packaged **as a read-only layer on QFieldCloud**. "
"Geopackages are [the recommended data format for QFieldCloud](https://docs.qfield.org/get-started/tutorials/get-started-qfc/#configure-your-project-layers-for-qfield). "
)
return FeedbackResult(f"{str(err)} {suffix}")

return None

Expand Down
Loading