huskar_api/api/organization.py
def post(self, team_name, application_name):
        """Ensures the related resources exist and gets an application token.

        .. note:: This is an internal API. We guarantee nothing if you are not
                  developers of Huskar and you are using this API.

        :param team_name: The name of team.
        :param application_name: The name of application.
        :status 400: The application_name is malformed.
        :status 403: Permission denied.
        :status 200: The token is in the response.
        """
        if not g.auth.is_admin:
            abort(403, 'user "%s" has no admin permission' % g.auth.username)

        owner_email = request.form['owner_email'].strip()
        validate_email(owner_email)
        owner_name = owner_email.split('@')[0]

        try:
            appinfo = AppInfo.from_external(
                team_name=team_name.lower(),
                application_name=application_name,
                owner_name=owner_name,
                owner_email=owner_email,
            )
            _, user = appinfo.submit_to_import()
        except NameOccupiedError:
            abort(400, 'malformed application: %s' % application_name)

        token = user.generate_token(settings.SECRET_KEY, None)
        return api_response(data={'token': token, 'expires_in': None})
Ensures the related resources exist and gets an application token.

        .. note:: This is an internal API. We guarantee nothing if you are not
                  developers of Huskar and you are using this API.

        :param team_name: The name of team.
        :param application_name: The name of application.
        :status 400: The application_name is malformed.
        :status 403: Permission denied.
        :status 200: The token is in the response.
        
Ensures the related resources exist and gets an application token.
note:: This is an internal API. We guarantee nothing if you are not
developers of Huskar and you are using this API.
Ensures the related resources exist and gets an application token . note :: This is an internal API . We guarantee nothing if you are not developers of Huskar and you are using this API .
def post(self, team_name, application_name):
        if not g.auth.is_admin:
            abort(403, 'user "%s" has no admin permission' % g.auth.username)
        owner_email = request.form['owner_email'].strip()
        validate_email(owner_email)
        owner_name = owner_email.split('@')[0]
        try:
            appinfo = AppInfo.from_external(
                team_name=team_name.lower(),
                application_name=application_name,
                owner_name=owner_name,
                owner_email=owner_email,
            )
            _, user = appinfo.submit_to_import()
        except NameOccupiedError:
            abort(400, 'malformed application: %s' % application_name)
        token = user.generate_token(settings.SECRET_KEY, None)
        return api_response(data={'token': token, 'expires_in': None})
def post ( self , team_name , application_name ) : if not g . auth . is_admin : abort ( 403 , 'user "%s" has no admin permission' % g . auth . username ) owner_email = request . form [ 'owner_email' ] . strip ( ) validate_email ( owner_email ) owner_name = owner_email . split ( '@' ) [ 0 ] try : appinfo = AppInfo . from_external ( team_name = team_name . lower ( ) , application_name = application_name , owner_name = owner_name , owner_email = owner_email , ) _ , user = appinfo . submit_to_import ( ) except NameOccupiedError : abort ( 400 , 'malformed application: %s' % application_name ) token = user . generate_token ( settings . SECRET_KEY , None ) return api_response ( data = { 'token' : token , 'expires_in' : None } )
Ensures the related resources exist and gets an application token.
Ensures the related resources exist and gets an application token .
"""Ensures the related resources exist and gets an application token.

        .. note:: This is an internal API. We guarantee nothing if you are not
                  developers of Huskar and you are using this API.

        :param team_name: The name of team.
        :param application_name: The name of application.
        :status 400: The application_name is malformed.
        :status 403: Permission denied.
        :status 200: The token is in the response.
        """
self
team_name
The name of team.
The name of team .
application_name
The name of application.
The name of application .
status
The application_name is malformed.
The application_name is malformed .
status
None
status
The token is in the response.
The token is in the response .