Skip to content

Commit

Permalink
Revert NLP usage limits checks, leave them for other PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Guitlle committed Oct 7, 2024
1 parent 59f492e commit fd201dd
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ def begin_google_operation(
submission_uuid = self.submission.submission_uuid
flac_content, duration = content
total_seconds = int(duration.total_seconds())
# Check if the user's organization has available usage credits
org = Organization.get_from_user_id(self.user.pk)
if get_organization_remaining_usage(org, 'seconds') < total_seconds:
raise UsageLimitExceeded

# Create the parameters required for the transcription
speech_client = speech.SpeechClient(credentials=self.credentials)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ def begin_google_operation(
logging.info(f'Found stored results in {output_path=}')
return (stored_result, len(content))

# Check if organization nlp usage limit has been exceeded
org = Organization.get_from_user_id(self.user.pk)
if get_organization_remaining_usage(org, 'character') < len(content):
raise UsageLimitExceeded

logging.info(
f'Starting async translation for {self.submission.submission_uuid=} {xpath=}'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,6 @@ class GoogleNLPSubmissionTest(BaseTestCase):

def setUp(self):
self.user = User.objects.get(username='someuser')
self.organization = Organization.objects.create(
id='123456abcdef', name='test organization'
)
self.organization.add_user(self.user, is_admin=True)
generate_plan_subscription(self.organization)
self.asset = Asset(
content={'survey': [{'type': 'audio', 'label': 'q1', 'name': 'q1'}]}
)
Expand Down

0 comments on commit fd201dd

Please sign in to comment.