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

Modify code to use the django admin page instead of the Categorizers table #132

Open
mZneit opened this issue Oct 26, 2021 · 4 comments
Open
Assignees

Comments

@mZneit
Copy link
Contributor

mZneit commented Oct 26, 2021

#100 (comment)

@khatchad
Copy link
Member

khatchad commented Nov 5, 2021

We know that a new categorizer hasn't logged in before if they are in the categorizers Django but do not have a row in the categorizers table. At that point, complete the rest of the table by asking them for their name and initials. Doing it this way, we don't need to trigger any row insertion. As soon as they login for the first time, ask them right away for the info you need (name and initials) and immediately create the row in the categorizers table.

@khatchad
Copy link
Member

khatchad commented Nov 9, 2021

  1. User logs in.
  2. If they are a categorizer per the Django group but do not have a corresponding row in the categorizers table, then:
  3. Redirect to the categorizer form (view). Make sure they are logged in on the view.
  4. Once they submit the categorizer form, redirect to the main page.

@khatchad
Copy link
Member

khatchad commented Nov 9, 2021

Test case: Mess with the URL. Instead of filling out the categorizer form, go to the main page and try to make a categorization. This should fail because there is no foreign key into the categorizers table to insert the categorization.

@khatchad
Copy link
Member

khatchad commented Nov 9, 2021

Use a form for categorizers. See https://docs.djangoproject.com/en/3.2/topics/forms/

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

No branches or pull requests

3 participants