Skip to content

Use the User model for foreign keys.

Ghost User requested to merge user-as-foreign-keys into master

Closes no issue.

Short description

Previously foreign keys pointed at Member objects. This created some issues as autocomplete_fields (in Django 2.0) and raw_id_fields require an Admin for the models that a foreign key points to. As Member has no Admin this meant that we could not use raw_id_fields and autocomplete_fields for Member.

This MR fixes this issue by replacing all foreign keys to Member with foreign keys to User.

In particular this MR does the following things:

  1. The events, pizzas, activemembers, and mailinglist apps now use the User model for foreign keys.
  2. The Member model has been renamed to Profile to reflect that it is (mostly) used for storage of extra information.
  3. A proxy to User called Member has been added. This allows us to override Managers and __str__ on User. Most methods that did not make sense in Profile have been moved to the new Member.
Edited by Ghost User

Merge request reports

Loading