Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should codelist_update allow a user to upload a new CSV file? #2087

Open
iaindillingham opened this issue Oct 16, 2024 · 2 comments
Open

Should codelist_update allow a user to upload a new CSV file? #2087

iaindillingham opened this issue Oct 16, 2024 · 2 comments

Comments

@iaindillingham
Copy link
Member

The codelist_create view allows a user to upload a CSV file to create an "old style" codelist.

@login_required
@load_owner
@require_permission
def codelist_create(request, owner):
if request.method == "POST":
return handle_post(request, owner)
return handle_get(request)

The CSV file need not adhere to a schema; the data in the CSV file are validated and cleaned and associated with the instance.

However, the corresponding codelist_update view doesn't allow a user to upload a new CSV file to update the codelist.

@login_required
@load_codelist
@require_permission
def codelist_update(request, codelist):
owner_choices = get_owner_choices(codelist, request.user)
if request.method == "POST":
return handle_post(request, codelist, owner_choices)
return handle_get(request, codelist, owner_choices)

@andrewscolm created a codelist from a CSV file that had code, term 1, and term 2 columns. However, he couldn't update this codelist from a new CSV file.1 Possibly Colm should create a new codelist?

It's not clear whether modifying codelist_update is desirable, given the distinction between "new style" and "old style" codelists.

Footnotes

  1. https://bennettoxford.slack.com/archives/C31D62X5X/p1728646729192689

@lucyb
Copy link
Contributor

lucyb commented Oct 22, 2024

We should speak to @andrewscolm and see how much effort it will be for him to create a new codelists and what implications there are if he does this.

@andrewscolm
Copy link

To update: this issue was due to opening the csv file with excel rather than the codelist_update function.

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

No branches or pull requests

3 participants