Skip to content

Commit cb542aa

Browse files
Use first user with id>0 in import_project_from_live
This avoids picking the anonymous user which would require adding the local test user as admin to the project before starting to debug it.
1 parent 8dc5d31 commit cb542aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

readthedocs/projects/management/commands/import_project_from_live.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def add_arguments(self, parser):
2525

2626
def handle(self, *args, **options):
2727
api = slumber.API(base_url='http://readthedocs.org/api/v1/')
28-
user1 = User.objects.order_by('pk').first()
28+
user1 = User.objects.filter(pk__gt=0).order_by('pk').first()
2929

3030
for slug in options['project_slug']:
3131
self.stdout.write('Importing {slug} ...'.format(slug=slug))

0 commit comments

Comments
 (0)