Skip to content

Conversation

@Carbrex
Copy link
Member

@Carbrex Carbrex commented Jan 6, 2024

Hey, this is my attempt for seeding of coach profiles. I used this module from lichess/lila and this Pr from @fitztrev . Can you help me how to run and check the code?
Closes #40

@fitztrev
Copy link
Member

fitztrev commented Jan 6, 2024

Thanks for the PR.

You'll also need to register the argument like this:

parser.add_argument(
"--streamers",
action="store_true",
help="""
if --streamers is present then 20% of users created will also be
streamers. by default no streamers are created.
""",
)

@fitztrev
Copy link
Member

fitztrev commented Jan 6, 2024

For testing it, if you use lila-gitpod, you can checkout your PR in the repos/lila-db-seed folder then if you modify the lila-docker file and add --coaches, you can run ./lila-docker db to test the seeder.

@Carbrex
Copy link
Member Author

Carbrex commented Jan 6, 2024

Thanks for the PR.

You'll also need to register the argument like this:

parser.add_argument(
"--streamers",
action="store_true",
help="""
if --streamers is present then 20% of users created will also be
streamers. by default no streamers are created.
""",
)

Ok thanks. I didnt see that in the pr so I had no idea about it.

For testing it, if you use lila-gitpod, you can checkout your PR in the repos/lila-db-seed folder then if you modify the lila-docker file and add --coaches, you can run ./lila-docker db to test the seeder.

Yes, I use lila-docker. I think it will be same for that.

@Carbrex
Copy link
Member Author

Carbrex commented Jan 7, 2024

Hey, I ran ./lila-docker db and I can see the coaches in the db but I don't see any coaches on the /coach route. Is there a way I can create a coach using predefined functions so that I can check what did I miss. The page in /coach has a way to apply for coach but I guess that won't be the right way because it redirects to a google form. Thanks for your time!

@fitztrev
Copy link
Member

fitztrev commented Jan 7, 2024

Yes, I think if you do this:

  1. log in as admin
  2. go to a profile of a titled player (may not be necessary to be titled, but the coaches on Lichess are so might as well)
  3. go to mod view of that user
  4. change their permissions - there should be a toggle switch of "is a coach"
  5. log in as that user, you should now be able to edit your coach profile

@Carbrex
Copy link
Member Author

Carbrex commented Jan 7, 2024

Yes, I think if you do this:

  1. log in as admin
  2. go to a profile of a titled player (may not be necessary to be titled, but the coaches on Lichess are so might as well)
  3. go to mod view of that user
  4. change their permissions - there should be a toggle switch of "is a coach"
  5. log in as that user, you should now be able to edit your coach profile

Thanks! that helped.

@Carbrex
Copy link
Member Author

Carbrex commented Jan 7, 2024

/coach page
image
/coach/{user} page
image
Thanks for your help! @fitztrev

@Carbrex Carbrex marked this pull request as ready for review January 7, 2024 17:08
@Carbrex Carbrex changed the title Attempted seed for coach Seed for coach Jan 7, 2024
@fitztrev
Copy link
Member

fitztrev commented Jan 7, 2024

Thanks!

@fitztrev fitztrev merged commit d11b6eb into lichess-org:master Jan 7, 2024
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.

Seed coach profiles

2 participants