Skip to content

25 reintegrate hermes target sharing from targetdetail page#26

Open
phycodurus wants to merge 21 commits into
12-dataservices-refactorfrom
25-re-integrate-hermes-target-sharing-from-targetdetail-page
Open

25 reintegrate hermes target sharing from targetdetail page#26
phycodurus wants to merge 21 commits into
12-dataservices-refactorfrom
25-re-integrate-hermes-target-sharing-from-targetdetail-page

Conversation

@phycodurus

Copy link
Copy Markdown
Member
  • Create TargetDetail button via integration point
  • moves HERMES configuration to settings.HERMES_CONFIGURATION
  • uses resovle_hermes_credentials() to check profile, then settings for creds
  • add all target data to draft message: User can edit on HERMES.

as of this commit, the URL target is returning:
    `Error code: 405 Method Not Allowed`
and move it to HERMES_CONFIGURATION. This separates
HERMES from the data_sharing options drop-down menus whose
menu-items are driven by the DATA_SHARING configurantion dict.
HERMES sharing is sufficiently different to be handled separately.
- The POST originates from a TargetDetail button, not the sharing
drop-down (as before).
- The most notable change here is to resolve
credentials with function `resolve_hermes_credentials`.
- Add all data associated with Target and user can edit draft message
on HERMES after they are redirected.
@phycodurus phycodurus requested a review from jchate6 June 27, 2026 02:16
@phycodurus phycodurus moved this to Needs Review in TOM Toolkit Jun 27, 2026

@jchate6 jchate6 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done a lot of work updating this code to be readable and functional with v3.
I didn't quite finish before I had to call it for the weekend.
If you do any work on this please let me know and push the results so I don't repeat any effort on Monday.

Comment thread tom_hermes/publisher.py Outdated
self.extra_info = kwargs


def publish_to_hermes(message_info, datums, targets=None, *, user=None, **kwargs):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure where this is used.

Comment thread tom_hermes/publisher.py
return message


def get_hermes_topics(*, user=None, **kwargs):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is used anymore either, but it may be someday...

Comment thread README.md
and `DEFAULT_TOPIC` if you want messages to default to a topic other than `'tomtoolkit.test'`.

### Custom Data
If you use custom data models, you can also create your own `DATA_CONVERTER_CLASS`. This setting should be the dot separated path to a class that converts your custom `ReducedDatum` or `Target` into a format understood by the [HERMES API](https://hermes.lco.global/about).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fill this out with an example of extending the existing HermesDataConverter

Comment thread tom_hermes/views.py
return HttpResponseRedirect(load_url)


class TargetGroupingHermesPreloadView(SingleObjectMixin, View):

@jchate6 jchate6 Jul 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't get here yet.
This doesn't seem to do anything currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

2 participants