Read and write a contact's note for the connection's owner (core #896) #30

Closed
opened 2026-10-14 08:22:35 +00:00 by tiagoagueda · 1 comment
Owner

Core #896 (landed as a01c4a3ab) made a contact's note each person's own: Contact.notes is no longer a column but a value read for somebody, and reading it without saying whose raises postulo.jobs.models.NotReadFor.

The sync reads and writes it directly:

  • src/postulo_dav/sync.py:143 — note=contact.notes when writing a card;
  • src/postulo_dav/sync.py:151 — contact.notes = card.note when reading one;
  • src/postulo_dav/sync.py:476 — appending to contact.notes.

What to do instead, per the plugin guide's new section:

  • read with contact.note_for(connection.owner) (or the queryset's with_notes(owner)), and write with contact.write_note(connection.owner, text);
  • read contacts with Contact.objects.visible_to(owner) and change them only within visible_to(owner, write=True) — a contact may now be a group's, or shared read-only;
  • making a contact with notes= still works, as its owner's own.

Repin to a01c4a3ab or later and run postulo.plugins.testing against it.

Core #896 (landed as `a01c4a3ab`) made a contact's note each person's own: `Contact.notes` is no longer a column but a value read *for somebody*, and reading it without saying whose raises `postulo.jobs.models.NotReadFor`. The sync reads and writes it directly: - `src/postulo_dav/sync.py:143` — `note=contact.notes` when writing a card; - `src/postulo_dav/sync.py:151` — `contact.notes = card.note` when reading one; - `src/postulo_dav/sync.py:476` — appending to `contact.notes`. What to do instead, per the plugin guide's new section: - read with `contact.note_for(connection.owner)` (or the queryset's `with_notes(owner)`), and write with `contact.write_note(connection.owner, text)`; - read contacts with `Contact.objects.visible_to(owner)` and change them only within `visible_to(owner, write=True)` — a contact may now be a group's, or shared read-only; - making a contact with `notes=` still works, as its owner's own. Repin to `a01c4a3ab` or later and run `postulo.plugins.testing` against it.
Author
Owner

Fixed by pull request #35, merged as fb8bbd7ae.

Fixed by pull request #35, merged as fb8bbd7ae.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo-dav#30
No description provided.