Skip to content

Commit

Permalink
prevent user to create a source if there is no link or file given
Browse files Browse the repository at this point in the history
  • Loading branch information
vasgat committed Feb 3, 2023
1 parent 2c308b5 commit 9e9dc67
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wikirate4py/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,9 @@ def add_source(self, **kwargs):
if k not in kwargs:
raise WikiRate4PyException("""Invalid set of params! You need to define all the following params to import
a new source in WikiRate platform: """ + required_params.__str__())
if 'link' not in kwargs and 'file' not in kwargs:
raise WikiRate4PyException("""Invalid set of params! You need to define either a link or give a file path to
upload a file while creating a new source: """ + required_params.__str__())

params = {
"card[type]": "Source",
Expand Down

0 comments on commit 9e9dc67

Please sign in to comment.