Skip to content

add integration points to tom eso#20

Merged
phycodurus merged 22 commits intodevfrom
19-add-integration-points-to-tom_eso
Jul 18, 2025
Merged

add integration points to tom eso#20
phycodurus merged 22 commits intodevfrom
19-add-integration-points-to-tom_eso

Conversation

@phycodurus
Copy link
Copy Markdown
Member

@phycodurus phycodurus commented Jun 17, 2025

I think these changes should be familiar to you @jchate6 because they are mostly about using the TOMToolkit integration points. Summary of the changes:

  • Add the ESOProfile model, partials, ESOProfileForm, View, UpdateView etc.
  • The ESOProfile model contains an EncryptedProperty
  • Added stand-alone (outside django project context) testing configuration

The tom_eso urlpatterns are namespaced in tom_eso_urls.py.
Since the facility template is being rendered by
tom_observations.views.ObservationCreateView, tom_observations
is the app whose urls are searched for the viewname. Since they
exist in tom_eso.urls, not tom_observatons.urls, we must provide
the specific namespace to look for them in.
@phycodurus phycodurus requested a review from Copilot June 17, 2025 02:40
@phycodurus phycodurus linked an issue Jun 17, 2025 that may be closed by this pull request
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR integrates new update and encryption handling features for the ESO Facility. Key changes include:

  • Adding the ProfileUpdateView class to enable user updates on ESO profiles.
  • Updating URL patterns and htmx endpoint references to use namespaced paths.
  • Introducing integration points in apps.py, extending model encryption logic, and adding corresponding tests and templates.

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tom_eso/views.py Adds a new UpdateView for updating user ESO profiles and handles form encryption keys.
tom_eso/urls.py Updates URL patterns to use namespaced view references and includes profile update URL.
tom_eso/tests.py Introduces tests for the custom encrypted binary field behavior.
tom_eso/templatetags/eso_extras.py Provides an inclusion tag to expose ESO profile data to templates.
tom_eso/templates/tom_eso/partials/eso_user_profile.html Adds a new partial template for displaying ESO profile information.
tom_eso/templates/tom_eso/eso_update_user_profile.html Introduces a simple form template for updating ESO profiles.
tom_eso/models.py Implements an EncryptedBinaryField and adds getter/setter for handling encrypted data.
tom_eso/migrations/* Contains migration files to alter and rename fields reflecting changes in encryption logic.
tom_eso/forms.py Provides a custom ModelForm for ESOProfile that integrates the encryption logic.
tom_eso/eso_api.py Adds a new TODO for potential renaming of a method for clarity.
tom_eso/eso.py Updates reverse_lazy calls to use namespaced URL names with htmx attributes.
tom_eso/apps.py Extends AppConfig with integration methods for profile details and field re-encryption.
Comments suppressed due to low confidence (1)

tom_eso/models.py:104

  • Typo in comment: '_chiphertext_p2_password' should be '_ciphertext_p2_password'.
# _chiphertext_p2_password is a memoryview object so it's probably Posgresql

@phycodurus phycodurus requested a review from jchate6 June 17, 2025 03:24
@phycodurus phycodurus marked this pull request as ready for review June 17, 2025 03:24
@jchate6 jchate6 moved this to Needs Review in TOM Toolkit Jun 20, 2025
@jchate6 jchate6 moved this from Needs Review to In progress in TOM Toolkit Jun 20, 2025
@phycodurus phycodurus marked this pull request as draft July 2, 2025 16:35
@phycodurus phycodurus self-assigned this Jul 2, 2025
Here's was Copilot has to say:
refactor ESOProfileForm and eso_profile_data to
use session utility for encryption handling
This should use the verbose_name attribute of the model Field
@jchate6 jchate6 moved this from In progress to Needs Review in TOM Toolkit Jul 16, 2025
Also, remove out-dated tests from before tom_common
EncryptedProperty refactor.
@phycodurus phycodurus marked this pull request as ready for review July 16, 2025 20:00
Copy link
Copy Markdown
Contributor

@jchate6 jchate6 left a comment

Choose a reason for hiding this comment

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

This generally looks really good to me. Had a few comments.

{% for field_data in profile_data_list %}
{% if field_data.value %}
<dt class="col-sm-6">{{ field_data.label }}</dt>
<dd class="col-sm-6">{{ field_data.value }}</dd>
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.

How do we feel about adding password here with a bunch of ******* instead of a value so people know it's editable from here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've just made it so the password appears in the CharField so User can edit it to update it.

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.

perfect.

@phycodurus phycodurus requested a review from jchate6 July 17, 2025 23:30
Copy link
Copy Markdown
Contributor

@jchate6 jchate6 left a comment

Choose a reason for hiding this comment

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

nice

@phycodurus phycodurus merged commit 7967a69 into dev Jul 18, 2025
10 checks passed
@github-project-automation github-project-automation bot moved this from Needs Review to Merged (to dev) in TOM Toolkit Jul 18, 2025
@phycodurus phycodurus deleted the 19-add-integration-points-to-tom_eso branch July 18, 2025 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

add integration points to tom_eso

3 participants