NERC-CEH / fit-count-app

Fit Count App & Website
Apache License 2.0
0 stars 0 forks source link

Linking samples to emails #106

Closed kitenetter closed 3 months ago

kitenetter commented 2 years ago

If I need to link samples to the email addresses of the users who contributed them I normally use cache_samples_nonfunctional.attr_email, but that attribute has not been populated for any of the FIT Count app samples.

Is there a reason why this does not happen?

I guess I can construct a query using the people and user tables instead of the cache attribute but it makes things more complicated!

Not sure if this is a question for Karolis or not - if not I will ask John.

kazlauskis commented 2 years ago

@johnvanbreda this app uses JWT authentication and upload the records directly to the warehouse. Is there something specific Martin needs to do to get the user emails from samples or is this is something we should tweak in the app or the API?

johnvanbreda commented 2 years ago

@kitenetter cache_samples_nonfunctional.attr_email will only be populated when specifically provided with a record submission. The FIT count app is relying on the association with the users table to identify user details, so there is no shortcut to getting the email from the users/people tables I'm afraid. If we took the step of copying the email from the people table, then it would cause more problems when email addresses change.