Skip to content

1473 reset drf api token feature#1483

Merged
phycodurus merged 3 commits intodevfrom
1473-reset-drf-api-token-feature
Mar 31, 2026
Merged

1473 reset drf api token feature#1483
phycodurus merged 3 commits intodevfrom
1473-reset-drf-api-token-feature

Conversation

@phycodurus
Copy link
Copy Markdown
Member

This takes standard approach (same as HERMES and Observation Portal):

  • creates a new RegenerateAPITokenView and it's urlpattern
  • adds DRF API token context to the UpdateUserView context
  • adds a template partial for HTMX redisplay of regenerated DRF API token
  • adds that template partial to user_create.html template
  • adds test for this

closes #1473

The create_user.html template is also used for the UpdateUserView.
This adds the DRF API token to that template as a partial template.
(It's a partial template so that HTMX can update it without a full
page reload).
Also add context to the UserUpdateView required
to display and regenerate the DRF API token.
@phycodurus phycodurus requested a review from jchate6 March 26, 2026 22:17
@phycodurus phycodurus moved this to Needs Review in TOM Toolkit Mar 26, 2026
@phycodurus
Copy link
Copy Markdown
Member Author

@jchate6 jchate6 self-assigned this Mar 27, 2026
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 looks good
I'd like to see some docs explaining how to use your API token.
Maybe something about using API tokens here

@phycodurus
Copy link
Copy Markdown
Member Author

documentation issue created

@phycodurus phycodurus merged commit 80be683 into dev Mar 31, 2026
26 checks passed
@github-project-automation github-project-automation bot moved this from Needs Review to Merged (to dev) in TOM Toolkit Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged (to dev)

Development

Successfully merging this pull request may close these issues.

Allow the User to reset their DRF API Token in the UserUpdateView(UpdateView)

2 participants