Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temp: fix use len(list) not list.count() in expire_and_create_entitlements #32565

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

pshiu
Copy link
Contributor

@pshiu pshiu commented Jun 23, 2023

Description

On running expire_and_create_entitlements, we get error:

TypeError: count() takes exactly one argument (0 given)
Full error:
Jun 23 20:32:00 ip-10-3-70-106 [service_variant=lms][celery.app.trace][env:stage-edx-edxapp] ERROR [ip-<redacted IP address>] [user None] [ip None] [trace.py:265] - Task common.djangoapps.entitlements.tasks.expire_and_create_entitlements[<redacted task id>] raised unexpected: TypeError('count() takes exactly one argument (0 given)')
Traceback (most recent call last):
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/celery/app/trace.py", line 451, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/newrelic/hooks/application_celery.py", line 99, in wrapper
    return wrapped(*args, **kwargs)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/celery/app/trace.py", line 734, in __protected_call__
    return self.run(*args, **kwargs)
  File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/edx_django_utils/monitoring/internal/code_owner/utils.py", line 193, in new_function
    return wrapped_function(*args, **kwargs)
  File "/edx/app/edxapp/edx-platform/common/djangoapps/entitlements/tasks.py", line 139, in expire_and_create_entitlements
    LOGGER.info('Successfully completed the task expire_and_create_entitlements after examining %d entries', entitlement_ids.count())  # lint-amnesty, pylint: disable=line-too-long
TypeError: count() takes exactly one argument (0 given)

This PR fixes that error.

Additional Information

@pshiu pshiu self-assigned this Jun 23, 2023
Copy link

@colinbrash colinbrash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@pshiu pshiu enabled auto-merge (squash) June 23, 2023 20:52
@pshiu pshiu merged commit fb9bf93 into master Jun 23, 2023
@pshiu pshiu deleted the pshiu/zubair-expire_create_entitlements_command branch June 23, 2023 21:05
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants