Skip to content

Commit 9e9dc67

Browse files
committed
prevent user to create a source if there is no link or file given
1 parent 2c308b5 commit 9e9dc67

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

wikirate4py/api.py

+3
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,9 @@ def add_source(self, **kwargs):
14371437
if k not in kwargs:
14381438
raise WikiRate4PyException("""Invalid set of params! You need to define all the following params to import
14391439
a new source in WikiRate platform: """ + required_params.__str__())
1440+
if 'link' not in kwargs and 'file' not in kwargs:
1441+
raise WikiRate4PyException("""Invalid set of params! You need to define either a link or give a file path to
1442+
upload a file while creating a new source: """ + required_params.__str__())
14401443

14411444
params = {
14421445
"card[type]": "Source",

0 commit comments

Comments
 (0)