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

REDBOX 257 - User demographic data #583

Merged
merged 21 commits into from
Jun 17, 2024

Conversation

brunns
Copy link
Contributor

@brunns brunns commented Jun 14, 2024

Context

Collect demographic data on our users.

Changes proposed in this pull request

Add grade, business unit and profession to the data model.

Allow upload of business unit data as CSV files via the admin interface.

If a user hasn't given us this data, pass them via a form on sign on.

Guidance to review

Relevant links

Things to check

  • I have added any new ENV vars in all deployed environments
  • I have tested any code added or changed
  • I have run integration tests

@brunns brunns marked this pull request as ready for review June 14, 2024 14:55
@brunns brunns force-pushed the feature/REDBOX-257-user-demographic-data branch from 34fd991 to 59e4d4b Compare June 14, 2024 15:27
@brunns brunns force-pushed the feature/REDBOX-257-user-demographic-data branch from 1b0bd36 to 5f41840 Compare June 17, 2024 09:50
@brunns brunns requested a review from gecBurton June 17, 2024 09:52
@brunns brunns marked this pull request as ready for review June 17, 2024 10:34
username = None
verified = models.BooleanField(default=False, blank=True, null=True)
invited_at = models.DateTimeField(default=None, blank=True, null=True)
invite_accepted_at = models.DateTimeField(default=None, blank=True, null=True)
last_token_sent_at = models.DateTimeField(editable=False, blank=True, null=True)
password = models.CharField("password", max_length=128, blank=True, null=True)
grade = models.CharField(null=True, max_length=3, choices=UserGrade)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we need blank=True as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think null=True is enough for all of them TBH. I don't think they should ever be blank.

Copy link
Collaborator

@gecBurton gecBurton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

models side LGTM, needs some input from @rachaelcodes or @KevinEtchells for the FE side

widgets: ClassVar[Mapping[str, forms.Widget]] = {
"grade": forms.Select(attrs={"class": "govuk-select"}),
"profession": forms.Select(attrs={"class": "govuk-select"}),
"business_unit": forms.Select(attrs={"class": "govuk-select"}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we sort these alphabetically for user ease?

@@ -53,8 +60,15 @@ def jemima_puddleduck():


@pytest.fixture()
def mrs_tiggywinkle():
return User.objects.create_user(email="[email protected]")
def mrs_tiggywinkle(business_unit: BusinessUnit) -> User:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth renaming this to something like user_with_demographic_info for test readability?

{% endfor %}
<div class="govuk-button-group">
{{ govukButton(text="Update") }}
{{ govukButton(text="Skip", href=url('documents')) }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brunns everything looks good to me, except I don't think it's a good idea to have 2 primary action buttons. Are you happy for me to make the "Skip" button grey?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go for it - or just suggest it here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just pushed the change :-)

@brunns brunns force-pushed the feature/REDBOX-257-user-demographic-data branch from 93150f4 to 4d3f294 Compare June 17, 2024 12:17
@brunns brunns merged commit 936fcc6 into main Jun 17, 2024
11 checks passed
@brunns brunns deleted the feature/REDBOX-257-user-demographic-data branch June 17, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants