stopstalk-deployment icon indicating copy to clipboard operation
stopstalk-deployment copied to clipboard

Re-enable Codechef is_invalid_handle_check

Open raj454raj opened this issue 6 years ago • 5 comments

Use https://github.com/stopstalk/stopstalk-deployment/blob/79911cdaf9e8ff0da963d044b286893144b189ec/modules/sites/codechef.py#L204 to replace https://github.com/stopstalk/stopstalk-deployment/blob/79911cdaf9e8ff0da963d044b286893144b189ec/modules/sites/codechef.py#L139

raj454raj avatar Oct 02 '19 19:10 raj454raj

Hey! Can I take up this issue?

punndcoder28 avatar Oct 04 '19 13:10 punndcoder28

Hey @punndcoder28 ! You can surely take this up, let me know if you have any issues and feel free to raise a PR

raj454raj avatar Oct 04 '19 15:10 raj454raj

Hey. If my understanding of the issue is correct do you want to replace the static method is_invalid_handle(handle with just _validate_handle(self)?

punndcoder28 avatar Oct 05 '19 14:10 punndcoder28

Hey @punndcoder28 ,

It's not that straight forward.

To use __validate_handle we need self.access_token to be set via __get_access_token method. You will have to think about how to make it independent of self and make it static method.

You can do something like the following -.

@staticmethod
def is_invalid_handle(handle):
    ...

@staticmethod
def __get_access_token():
    ...

@staticmethod
def __validate_handle(handle, access_token):
    ...

You can also test this without needing the Codechef api tokens, just return some dummy values and make sure with print statements are printed from web2py shell python web2py -S stopstalk -M

raj454raj avatar Oct 05 '19 16:10 raj454raj

Hey @raj454raj . I've opened a PR #383. Can you check if this is right. Let me know if any mistakes are present or any changes are required.

punndcoder28 avatar Oct 07 '19 15:10 punndcoder28