appsembler / xblock-grade-fetcher

Grade Fetcher XBlock
MIT License
2 stars 1 forks source link

is_valid_url() is broken #30

Closed thraxil closed 2 years ago

thraxil commented 2 years ago

The is_valid_url() method: https://github.com/appsembler/xblock-grade-fetcher/blob/master/gradefetcher/gradefetcher.py#L200

Has the signature:

def is_valid_url(url):

There's no self as a first argument. That means that any subsequent calls as a method, like https://github.com/appsembler/xblock-grade-fetcher/blob/master/gradefetcher/gradefetcher.py#L321 or https://github.com/appsembler/xblock-grade-fetcher/blob/master/gradefetcher/gradefetcher.py#L360

Will always fail with TypeError: is_valid_url() takes 1 positional argument but 2 were given.

thraxil commented 2 years ago

Options would be to either add a self, so it's a proper method, make it a staticmethod, or just pull it out of the class so it's a regular function.

amirtds commented 2 years ago

Thanks @thraxil Great catch. I created #31

thraxil commented 2 years ago

FWIW: if you put a message like "closes #30" in the git commit comment or the PR description, github will automatically link it back to this issue and close the issue when the PR is merged.

amirtds commented 2 years ago

Thanks, I closed the PR before seeing your message, will try it for the next issue