Skip to content

Commit

Permalink
remove doesnotexist
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammad-ammar committed Oct 10, 2017
1 parent 2b74907 commit 3e1b105
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions edxval/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,14 @@ def get_transcript_credentials_state_for_org(org, provider=None):
u'Cielo24': True
}
"""
credentials_state = {}
query_filter = {'org': org}
if provider:
query_filter['provider'] = provider

try:
credentials_state = {
credential.provider: credential.exists
for credential in ThirdPartyTranscriptCredentialsState.objects.filter(**query_filter)
}
except ThirdPartyTranscriptCredentialsState.DoesNotExist:
pass

return credentials_state
return {
credential.provider: credential.exists
for credential in ThirdPartyTranscriptCredentialsState.objects.filter(**query_filter)
}


def update_transcript_credentials_state_for_org(org, provider, exists):
Expand Down

0 comments on commit 3e1b105

Please sign in to comment.