Member model is DEPRECATED. All functionality moved to User or UserProfile.
user_type is now a property of User – since that is the model where the relevant data is.
UserProfile.id_token_payload is now stored from VMI during login, and near all other model properties are removed (except UserProfile.subject is retained, and set during login from the id_token, because we need to query / filter on it).
Relationships between Organizations and Users are now normalized:
Organization.members = Users who are members of the Organization.
Organization.agents = Users who are agents of the Organization (used to be the confusingly-named Organization.users)
User.member_organizations = reverse of Organization.members
User.agent_organizations = reverse of Organization.agents
Being a "member" is thus a property of the relationship, as is being an agent.
member app still active – this is still the natural place to keep all /member functionality.
I disabled UserSettingsView, because it will be superceded by POST to /member/ID (apps.member.views.ProfileView). – I started doing this whole PR so I could cleanly implement POST to VMI when editing a member profile!
Fixed the header navbar so that the dropdown always works.
In addition I applied isort + black to auto-format the code, which is pretty rigid, but removes all questions about code formatting and has very good defaults.
These are now in the dev-requirements.txt file.
There is a new pyproject.toml file that configures black.
run ./fmtlint.sh to automate this before commit. That command also runs flake8, so you can see any flake8 issues.
All automated tests pass, and I've hand-tested all the core functionality of the app (since this PR touches everything).
HUGE REFACTOR:
In addition I applied isort + black to auto-format the code, which is pretty rigid, but removes all questions about code formatting and has very good defaults.
./fmtlint.sh
to automate this before commit. That command also runs flake8, so you can see any flake8 issues.All automated tests pass, and I've hand-tested all the core functionality of the app (since this PR touches everything).