Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Customize StudentAddForm by Group Category #106

Open
9 tasks
ckleemann opened this issue Oct 5, 2016 · 0 comments
Open
9 tasks

Customize StudentAddForm by Group Category #106

ckleemann opened this issue Oct 5, 2016 · 0 comments

Comments

@ckleemann
Copy link
Contributor

Current Situation

The StudentAdd view is a simple CreateView which was enhanced with some logic if student can register for the exam or not in d299320.

But for some situations it is required to customize the StudentAdd view dependent on the group category of the freshman. As it is mentioned in #63.

At the moment the group category model only has as a label. It is not sufficient do base the logic on a simple CharField.

Suggested Improvement

Since a freshman can only access the view by the assistance of a tutor the group category should be set inside the URL. To allow all of the configuration via the admin interface the following steps are required:

Required subtasks

  • Extend the GroupCategory model with some field that allows to base logic on it. For example it could be some field which has a given set of choices. See Schedule model of the website app.
  • Add a many-to-many field to the newsletter model which stores all group categories that should be able to subscribe to this newsletter.
  • Add a settings model to the exam app which stores all group categories that should be able to register for the exam and a registration_enabled BooleanField.
  • Add the group category identifier to the StudentAdd View URL pattern.
  • Rewrite the base URL (the URL without the group category identifier given) of the StudentAdd View to list all possible group categories and link to the corresponding registration view.
  • Rewrite the StudentRegisterForm so it only displays the want_exam field if the group category can register for the exam and the registration is enabled.
  • Change the Queryset of the newsletters Field in StudentRegisterForm so that only newsletters for the group category are displayed.
  • Change the Queryset of the tutor_group Field in StudentRegisterForm so that only tutorGroups which are part of the group category are displayed.
  • Vaildate the posted data against this constrains in the StudentAdd form

Open Questions

  • Are the limitations in the newsletters Queryset also required for the admin interface?
@ckleemann ckleemann added this to the ophase-ss17 milestone Oct 5, 2016
ckleemann added a commit that referenced this issue Oct 5, 2016
…"Studenten Registrierung aktiv" since #106 might change the behavior
@bhaettasch bhaettasch modified the milestones: ophase-future, ophase-ss17 Apr 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants