本文整理汇总了Python中openedx.core.djangoapps.api_admin.models.ApiAccessRequest.api_access_status方法的典型用法代码示例。如果您正苦于以下问题:Python ApiAccessRequest.api_access_status方法的具体用法?Python ApiAccessRequest.api_access_status怎么用?Python ApiAccessRequest.api_access_status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openedx.core.djangoapps.api_admin.models.ApiAccessRequest
的用法示例。
在下文中一共展示了ApiAccessRequest.api_access_status方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from openedx.core.djangoapps.api_admin.models import ApiAccessRequest [as 别名]
# 或者: from openedx.core.djangoapps.api_admin.models.ApiAccessRequest import api_access_status [as 别名]
def get(self, request):
"""
If the requesting user has already requested API access, redirect
them to the client creation page.
"""
if ApiAccessRequest.api_access_status(request.user) is not None:
return redirect(reverse('api_admin:api-status'))
return super(ApiRequestView, self).get(request)
示例2: get
# 需要导入模块: from openedx.core.djangoapps.api_admin.models import ApiAccessRequest [as 别名]
# 或者: from openedx.core.djangoapps.api_admin.models.ApiAccessRequest import api_access_status [as 别名]
def get(self, request):
"""
If the user has not created an API request, redirect them to the
request form. Otherwise, display the status of their API request.
"""
status = ApiAccessRequest.api_access_status(request.user)
if status is None:
return redirect(reverse('api_admin:api-request'))
return render_to_response('api_admin/status.html', {
'status': status,
'api_support_link': _('TODO'),
'api_support_email': settings.API_ACCESS_MANAGER_EMAIL,
})
示例3: test_no_access
# 需要导入模块: from openedx.core.djangoapps.api_admin.models import ApiAccessRequest [as 别名]
# 或者: from openedx.core.djangoapps.api_admin.models.ApiAccessRequest import api_access_status [as 别名]
def test_no_access(self):
self.request.delete() # pylint: disable=no-member
self.assertIsNone(ApiAccessRequest.api_access_status(self.user))
示例4: test_no_access
# 需要导入模块: from openedx.core.djangoapps.api_admin.models import ApiAccessRequest [as 别名]
# 或者: from openedx.core.djangoapps.api_admin.models.ApiAccessRequest import api_access_status [as 别名]
def test_no_access(self):
self.request.delete()
self.assertIsNone(ApiAccessRequest.api_access_status(self.user))