biocore / biocore/microsetta-private-api

Centralize string literals for e.g. account form variables

Open
#195 0 comments 0 reactions 0 assignees View on GitHub
minimalInterface
Dominant language
Python
Stars
6
Forks
18
PR merge metrics
No merged PRs in 30d

Description

Right now we use the string names for each form variable in account creation/update in at least 3 places. Here is an example for "first_name", which is used in the actual form set-up, such as
``
as well as in the javascript validation, like
`rules { first_name: "required",`
AND in the python processing of the form, as in
`ACCT_FNAME_KEY: body['first_name'],` .

This is fragile so we should centralize. Doing so means we need to define each field name constant somewhere in python, then pass each constant into the templates that use it and put it into the html--and relevant javascript!--with `{{ }}` syntax so that it is guaranteed the same everywhere it is used. That kind of change makes the templates harder to read and maintain, so we'd want do to it thoughtfully.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the account creation/update form setup, JavaScript validation, and Python form processing described in the issue, then inventory every duplicated field name. Done means the shared field definitions are used consistently across the HTML, JavaScript, and Python paths without changing account-form behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript, python
Domain
full-stack
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.