Skip to content

Fix missing sync repo task #3265

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

Merged
merged 2 commits into from
Nov 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions readthedocs/oauth/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default_app_config = 'readthedocs.oauth.apps.OAuthConfig'
12 changes: 12 additions & 0 deletions readthedocs/oauth/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""OAuth app config"""

from django.apps import AppConfig


class OAuthConfig(AppConfig):
name = 'readthedocs.oauth'

def ready(self):
from .tasks import SyncRemoteRepositories
from readthedocs.worker import app
app.tasks.register(SyncRemoteRepositories)
2 changes: 2 additions & 0 deletions readthedocs/oauth/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

@permission_check(user_id_matches)
class SyncRemoteRepositories(PublicTask):

name = __name__ + '.sync_remote_repositories'
public_name = 'sync_remote_repositories'
queue = 'web'

Expand Down
2 changes: 1 addition & 1 deletion readthedocs/restapi/views/task_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def job_status(request, task_id):
@decorators.permission_classes((permissions.IsAuthenticated,))
@decorators.renderer_classes((JSONRenderer,))
def sync_remote_repositories(request):
result = tasks.sync_remote_repositories.delay(
result = tasks.SyncRemoteRepositories().delay(
user_id=request.user.id)
task_id = result.task_id
return Response({
Expand Down