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

Fix/sorted section list 467 #790

Merged
merged 3 commits into from
Nov 8, 2023
Merged

Conversation

hato1883
Copy link
Contributor

@hato1883 hato1883 commented Nov 8, 2023

Description of the Change
Changed the frontend register page to use to use sorted version of the Section queryset by adding:

section = forms.ModelChoiceField(
        required=False,
        queryset=Section.objects.order_by('abbreviation'),
        label=_('Section'),
)

Where abbreviation is the column we sort for.
This also fixes the problem when editing your section on your homepage.

Applicable Issues
fixes #467 and makes the sections ordered by their abbreviations

This is the same form that admin page uses when creating users.
RegistrationForm is not affected by change in forms.py in commit:
9be07d3
and thereby did not get a sorted section list from previous change.
I do not see the diffrence in accont creation between the two forms.
Changed so that section sorting occurs on all ModelForm's.
This allows us to yet again use a custom ModelForm for admin page
and another for the registration page.
@robindymer robindymer merged commit b444ff6 into development Nov 8, 2023
1 check passed
robindymer added a commit that referenced this pull request Dec 6, 2023
* Bug fix. Removed unnecessary text next to the title in webpage (#785)

* Fix/sorted section list 467 (#790)

* Sort section list by its abbreviation

* Changed RegistrationForm to CustomUserCreationForm
This is the same form that admin page uses when creating users.
RegistrationForm is not affected by change in forms.py in commit:
9be07d3
and thereby did not get a sorted section list from previous change.
I do not see the diffrence in accont creation between the two forms.

* Changed forms.py
Changed so that section sorting occurs on all ModelForm's.
This allows us to yet again use a custom ModelForm for admin page
and another for the registration page.

* Fixed number check. (#791)

Reusing the the check that is used when creating a member on
https://utn.se/accounts/register/

* Fix footer translation (#794)

* fixed the quickfix, added translation string to po

* Test changing req.

* Undo

* Test #2

---------

Co-authored-by: Robin Dymér <[email protected]>

* rename melos to unicore (#784)

* rename melos to unicore

* fix formatting

* Fix lint

* Fix migrations

* Fix build check bug

---------

Co-authored-by: Robin Dymér <[email protected]>

* Forced date to be handeld with swedish format (#793)

* Forced date to be handeld with swedish format

* Fix build issue

---------

Co-authored-by: Robin Dymér <[email protected]>

---------

Co-authored-by: GansaK <[email protected]>
Co-authored-by: Hampus Toft <[email protected]>
Co-authored-by: Ludvig Aldén <[email protected]>
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.

When you register an account, sections are not sorted
2 participants