Skip to content
  • Giorgos Korfiatis's avatar
    astakos: Refactor user creation · 5f307667
    Giorgos Korfiatis authored
    Provide auth.make_user() as the single way to create a new user. This
    function is responsible to set all automatically generated fields, such as
    username, uuid, and token. Clean up AstakosUser.save(), that used to
    update these fields, and remove AstakosUser.__init__(). Remove trigger
    that renewed token on every AstakosUser update. In order to set a user's
    email, use AstakosUser.set_email(); this takes care to update the
    username, too.
    
    Provide function create_user() in user creation forms, which calls
    auth.make_user() with the form-provided data.
    
    Use the wrapper auth.make_local_user() in management command `user-add'.
    
    Use the same infrastructure to extend a django superuser to an AstakosUser
    (in management command `fix-superusers').
    5f307667