Skip to content

Commit

Permalink
updating the addtoken script for cleant deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
ooemperor committed Feb 18, 2024
1 parent 44bafc5 commit c27241b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions codeGrader/scripts/cgAddApiToken.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import sys


def main(description):
def add_token(description):
"""
Generate a API Token for the backend api, create the object in the database
Return the token itself in a print statement
Expand All @@ -45,15 +45,19 @@ def main(description):
print(token)


if __name__ == '__main__':
def main():
"""
Parsing the description argument via a ArgumentParser
Parsing the description argument via a ArgumentParser and creating the user in the database
"""
parser = argparse.ArgumentParser(
description="Add API Key to the Database"
)
parser.add_argument('-d', 'description')
parser.add_argument('-d', '--description')

args = parser.parse_args()
add_token(args.description)


if __name__ == '__main__':

sys.exit(main(args.description))
sys.exit(main())

0 comments on commit c27241b

Please sign in to comment.