huskar_api/api/auth.py
def delete(self, username):
        """Dismisses an user from site admin.

        :form username: The username of dismissed user.
        :<header Authorization: Huskar Token (See :ref:`token`)
        :status 403: The dismissing is not permitted.
        :status 404: The user is not found.
        :status 200: The user has been dismissed successfully.
        """
        g.auth.require_admin('only admin can delete admin')

        user = self._get_user_or_404(username)
        if user.username == g.auth.username:
            abort(403, 'It is not allowed to dismiss yourself')
        with audit_log(audit_log.types.DISMISS_HUSKAR_ADMIN, user=user):
            user.dismiss_admin()
        return api_response()
Dismisses an user from site admin.

        :form username: The username of dismissed user.
        :<header Authorization: Huskar Token (See :ref:`token`)
        :status 403: The dismissing is not permitted.
        :status 404: The user is not found.
        :status 200: The user has been dismissed successfully.
        
Dismisses an user from site admin.
Dismisses an user from site admin .
def delete(self, username):
        g.auth.require_admin('only admin can delete admin')
        user = self._get_user_or_404(username)
        if user.username == g.auth.username:
            abort(403, 'It is not allowed to dismiss yourself')
        with audit_log(audit_log.types.DISMISS_HUSKAR_ADMIN, user=user):
            user.dismiss_admin()
        return api_response()
def delete ( self , username ) : g . auth . require_admin ( 'only admin can delete admin' ) user = self . _get_user_or_404 ( username ) if user . username == g . auth . username : abort ( 403 , 'It is not allowed to dismiss yourself' ) with audit_log ( audit_log . types . DISMISS_HUSKAR_ADMIN , user = user ) : user . dismiss_admin ( ) return api_response ( )
Dismisses an user from site admin.
Dismisses an user from site admin .
"""Dismisses an user from site admin.

        :form username: The username of dismissed user.
        :<header Authorization: Huskar Token (See :ref:`token`)
        :status 403: The dismissing is not permitted.
        :status 404: The user is not found.
        :status 200: The user has been dismissed successfully.
        """
self
username
form
The username of dismissed user.
The username of dismissed user .
<header
Huskar Token (See :ref:`token`)
Huskar Token ( See : ref : ` token ` )
status
The dismissing is not permitted.
The dismissing is not permitted .
status
The user is not found.
The user is not found .
status
The user has been dismissed successfully.
The user has been dismissed successfully .