Example #1
0
    def community_teamkey_update(self, request):
        if not is_auth_user_admin(headers=self.request_state.headers):
            return ResponseMessage(success=False)

        Community.update_teamkey(request)
        new_user_team_token = update_user_team_token(headers=self.request_state.headers, team_key=request.new_team_key)
        return ResponseMessage(success=True, msg=json.dumps(new_user_team_token))
Example #2
0
    def reset_team_secret(self, request):
        if not is_auth_user_admin(headers=self.request_state.headers):
            return CommunityValueMessage(secret=None)

        secret = Community.reset_team_secret(request.team_key)
        new_user_team_token = update_user_team_token(headers=self.request_state.headers, team_secret=secret)
        return CommunityValueMessage(secret=secret, user_team_token=json.dumps(new_user_team_token))