Skip to content

Commit

Permalink
fix: Fix Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
drorganvidez committed Jul 8, 2024
1 parent 66c8004 commit d55a3db
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions app/modules/zenodo/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from core.configuration.configuration import uploads_folder_name
from dotenv import load_dotenv
from flask import current_app, jsonify, Response
from flask import jsonify, Response
from flask_login import current_user

from app.modules.dataset.models import DataSet, FeatureModel
Expand All @@ -31,7 +31,6 @@ def get_zenodo_url(self):
ZENODO_API_URL = os.getenv("ZENODO_API_URL", "https://sandbox.zenodo.org/api/deposit/depositions")

return ZENODO_API_URL


def get_zenodo_access_token(self):
return os.getenv("ZENODO_ACCESS_TOKEN")
Expand All @@ -42,7 +41,6 @@ def __init__(self):
self.ZENODO_API_URL = self.get_zenodo_url()
self.headers = {"Content-Type": "application/json"}
self.params = {"access_token": self.ZENODO_ACCESS_TOKEN}


def test_connection(self) -> bool:
"""
Expand Down Expand Up @@ -71,9 +69,8 @@ def test_full_connection(self) -> Response:
with open(file_path, "w") as f:
f.write("This is a test file with some content.")


messages = [] # List to store messages

# Step 1: Create a deposition on Zenodo
data = {
"metadata": {
Expand All @@ -85,7 +82,7 @@ def test_full_connection(self) -> Response:
}

response = requests.post(self.ZENODO_API_URL, json=data, params=self.params, headers=self.headers)

if response.status_code != 201:
return jsonify(
{
Expand All @@ -94,7 +91,6 @@ def test_full_connection(self) -> Response:
}
)


deposition_id = response.json()["id"]

# Step 2: Upload an empty file to the deposition
Expand All @@ -121,7 +117,6 @@ def test_full_connection(self) -> Response:
if os.path.exists(file_path):
os.remove(file_path)


return jsonify({"success": success, "messages": messages})

def get_all_depositions(self) -> dict:
Expand Down

0 comments on commit d55a3db

Please sign in to comment.