HUE-408 [desktop] User creation form usage when first creating a user

Review Request #2521 — Created Dec. 12, 2012 and submitted

abec
old-hue-rw
HUE-408
hue
enricoberti, romain
commit 40012f00b8e1eb6b0ee1cb755802341801b6f8de
Author: abec <abe@cloudera.com>
Date:   Tue Dec 11 19:22:48 2012 -0800

    HUE-408 [desktop] User creation form usage when first creating a user
    
    Added custom auth and user creation forms to validate authentication
    and user creation. Added defensive logic around creating first user.
    Added test case to ensure this.

:000000 100644 0000000... f87ac09... A	desktop/core/src/desktop/auth/forms.py
:100644 100644 88a8678... 5438fa4... M	desktop/core/src/desktop/auth/views.py
:100644 100644 2a0ad6e... 0a91847... M	desktop/core/src/desktop/auth/views_test.py
:100644 100644 4bac816... abbf9b6... M	desktop/core/src/desktop/templates/login.mako
:100644 100644 e908fdd... 003212c... M	desktop/core/src/desktop/views.py
Manual + test slow
  • 0
  • 0
  • 4
  • 2
  • 6
Description From Last Updated
romain
  1. Nice to add the forms, but could we simplify the logic? (e.g. make it readable without hard thinking)
  2. desktop/core/src/desktop/auth/views.py (Diff revision 1)
     
     
    defensive also means we should init it to 'True'
  3. desktop/core/src/desktop/auth/views.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    This is complicated to follow. Couldn't we manage the cases independently?
    
    e.g.
    
    1) is first user, get him from the form
    2) check auth
    3) if new user not ok delete him
    4) if new user ok createhome dir 
    
    1. I can't use the user from returned by UserCreationForm.save. It is missing the 'backends' member, which is used in login. I'll add a comment explaining this in code.
  4. 
      
abec
romain
  1. Nice!
  2. desktop/core/src/desktop/auth/views.py (Diff revisions 1 - 2)
     
     
    do we need a 'first_user_form.save()' or auth_form.get_user() creates him if not there?
    1. authenticate creates if the user doesn't exist!
  3. desktop/core/src/desktop/auth/views.py (Diff revisions 1 - 2)
     
     
    just user.username too?
  4. 
      
abec
Review request changed

Status: Closed (submitted)

Loading...