Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Conversation

@garoller
Copy link
Contributor

Summary of major changes:

  • Remove custom User model. Using Django's built-in User model.
  • Login using CAS (django-ng-cas) and WTG's identity service.
  • Add petition detail view to see author, description, signatures, expiration date.
  • Add sign functionality, if a user is logged in and has not signed that petition already.

Minor changes:

  • Run travis with the python 3.6 xenial distribution. Travis builds started failing, and this change fixed that.
  • Update lock file and instructions in the README for installing dependencies.
  • Style changes to the navbar.

Closes #2 and #31.

This is a preliminary design for the detail view, so feedback on the style and how it can be improved would be great.

@garoller garoller requested a review from jlyon1 April 11, 2019 13:42
@garoller garoller added the ready label Apr 11, 2019
Copy link

@jlyon1 jlyon1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good 💯. A few minor changes around the relationship between petitions and signatures, as well as thoughts on authentication.

On the detail view: Looks good, however it is a little small on mobile, due to the display not collapsing or resizing text. This does appear to be an issue on the site as a whole. Example on iphone X:
image

Other points that should be fixed at some point but may be outside the scope of this PR:

  • The ID can be set and can be negative, negative IDs cause an error on the site
  • There is a field labeled '300' on the admin interface which actually represents the number of signatures
  • Admins can assign signature to petitions, this should not be allowed.



class StudentCASBackend(CASBackend):
def user_can_authenticate(self, user):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A debug mode would be helpful here so that we can test with different users or bypass cas entirely

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I searched around, and there doesn't seem like an easy way to do this. For now, I added that if debug mode is true, then the user is set to a superuser, which at least avoids accessing the database to set permissions.

I think what you suggested is a good idea, but I think we can create an issue for this, as opposed to including it in this PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User Login(CAS Authentication)

3 participants