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

Organization geographic scope, code availability can't be edited #64

Closed
greatislander opened this issue May 26, 2020 · 2 comments · Fixed by #92
Closed

Organization geographic scope, code availability can't be edited #64

greatislander opened this issue May 26, 2020 · 2 comments · Fixed by #92
Assignees
Labels
bug Something isn't working
Milestone

Comments

@greatislander
Copy link
Contributor

greatislander commented May 26, 2020

Describe the bug

When exploring the choices field as mentioned in #59 (comment), I noticed that the geographic scope and code availability fields for organizations are not currently editable in the Django admin.

To Reproduce

Steps to reproduce the behavior:

  1. Edit an organization.
  2. Try to modify the geographic scope or code availability fields and save the organization.
  3. See error: Select a valid choice. 0 is not one of the available choices.

Expected behavior

Geographic scope and code availability can be edited.

Screenshots

Screen Shot 2020-05-26 at 1 07 54 PM

Additional Context

I believe the issue here is that the values the list of choices are integers (unquoted) but the models stipulate a CharField which expects strings. If there's existing data saved in this field this issue could be resolved by changing geo_scope and code_availability to use an IntegerField.

Alternative solutions include quoting the values to make them strings:

choices=[('0', 'Local'), ('1', 'Regional'), ('2', 'National'), ('3', 'International')],

Or changing the values to a more meaningful string:

choices=[('local', 'Local'), ('regional', 'Regional'), ('national', 'National'), ('international', 'International')],

I am happy to open a PR to implement the preferred solution.

@greatislander greatislander added the bug Something isn't working label May 26, 2020
@greatislander greatislander self-assigned this May 26, 2020
@greatislander greatislander added this to the Alpha milestone May 26, 2020
@greatislander greatislander changed the title Organization geographic scope can't be edited Organization geographic scope, code availability can't be edited May 26, 2020
@erictheise
Copy link
Member

This is true, although a number of fields from Trebor's survey are still being migrated and this work should not be considered complete.

@greatislander
Copy link
Contributor Author

Thanks, @erictheise. My understanding is that you are still working on importing/inputting 2020 Ecosystem survey data, and that process might impact the final state of these fields. Is that captured by #17 and #21? Is there any more detail on the progress of that work other than the commit log referencing those tickets? I'd love to get a clearer understanding.

I'm preparing to start work on refining/completing the organizational and individual profile pages (#6 and #7) as well as implementing filtering and searching (#36 and #51), so I want to get a sense of what data changes might still need to be made so I can help move that forward. Happy to have a call do discuss if that helps as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants