harvard-lil / h2o

H2O is a web app for creating and reading open educational resources, primarily in the legal field
https://opencasebook.org
GNU Affero General Public License v3.0
36 stars 30 forks source link

Allow new users to self-identify as a particular user type #2001

Closed lizadaly closed 1 year ago

lizadaly commented 1 year ago

This leverages the Django built-in Group model (which H2O did not previously use) to let users select from a predefined list of groups to which they may belong. Django Groups are typically used to gather up permissions, as for the admin, but they aren't restricted to that use and are a convenient ManyToMany relationship already available to the User.

This PR:

Smaller items:

Signup form

Looks like this now:

image

Admin list page

Added the new groups filter on the right, and customized the display of the groups in the list view to be comma-delimited vlaues.

image
codecov-commenter commented 1 year ago

Codecov Report

Merging #2001 (5886aff) into develop (41da74a) will decrease coverage by 0.01%. The diff coverage is 83.33%.

@@             Coverage Diff             @@
##           develop    #2001      +/-   ##
===========================================
- Coverage    76.83%   76.82%   -0.01%     
===========================================
  Files           62       62              
  Lines         6916     6927      +11     
===========================================
+ Hits          5314     5322       +8     
- Misses        1602     1605       +3     
Impacted Files Coverage Δ
web/main/views.py 72.04% <ø> (ø)
web/main/admin.py 69.44% <80.00%> (+0.05%) :arrow_up:
web/main/forms.py 90.19% <84.61%> (-0.67%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.