Skip to content

Commit

Permalink
Remove unnecessary print statements
Browse files Browse the repository at this point in the history
Removed debug print statements scattered throughout the codebase. This was done to improve code readability and reduce clutter, particularly in production where these debug outputs are unnecessary. The removed print statements were mainly used for debugging purposes and are no longer needed now that those features have been developed and tested.
  • Loading branch information
Zerskk committed Nov 30, 2023
1 parent 1ca148f commit 1c77170
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 15 deletions.
4 changes: 0 additions & 4 deletions app/api/endpoints/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ async def publish_project(request: Request, background_tasks: BackgroundTasks,
except:
raise HTTPException(status_code=403, detail="No metadata available.")

print("metadata", metadata)

metadata_model = Metadata(**metadata)

identifier_url = f"https://git.nfdi4plants.org/projects/{project.id}"
Expand All @@ -134,8 +132,6 @@ async def publish_project(request: Request, background_tasks: BackgroundTasks,

metadata_model = remove_email_identifiers(metadata_model)

print("metadata", metadata)

invenio_api = Invenio_API()

data_object = []
Expand Down
1 change: 0 additions & 1 deletion app/api/middlewares/github_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ async def github_authentication(request: Request, x_hub_signature_256: str = Hea
payload = await request.body()
secret = os.environ.get("GITHUB_SECRET").encode("utf-8")
signature = generate_hash_signature(secret, payload)
print("in auth")
if x_hub_signature_256 != f"sha256={signature}":
raise HTTPException(status.HTTP_401_UNAUTHORIZED,
detail="Not Authorized")
Expand Down
3 changes: 0 additions & 3 deletions app/api/middlewares/jwt_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ def __init__(self, auto_error: bool = True):

async def __call__(self, request: Request):
credentials: HTTPAuthorizationCredentials = await super(JWTBearer, self).__call__(request)
print("credentials", credentials)
if credentials:
if not credentials.scheme == "Bearer":
print("no Bearer token")
raise HTTPException(status_code=403, detail="Invalid authentication scheme.")
if not self.verify_jwt(credentials.credentials):
raise HTTPException(status_code=403, detail="Invalid token or expired token.")
Expand All @@ -29,7 +27,6 @@ async def __call__(self, request: Request):

def verify_jwt(self, jwtoken: str) -> bool:
isTokenValid: bool = False
print("jwt token", jwtoken)

try:
payload = self.decodeJWT(jwtoken)
Expand Down
5 changes: 0 additions & 5 deletions app/email/Mailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ def __init__(self, smtp_server="smtp.office365.com", port=587, username=None, pa

self.root_message = MIMEMultipart('related')

print(self.port)
print(self.username)
print(self.receiver)


def create_basemail(self):
"""
Create a base email message.
Expand Down
2 changes: 0 additions & 2 deletions app/tasks/email/send_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@


def send_testmail(receiver: str):
print("in task mail \n\n\n\n")

smtp_server = os.getenv("EMAIL_SERVER")
username = os.getenv("EMAIL_USERNAME")
sender = os.getenv("EMAIL_SENDER")
Expand Down

0 comments on commit 1c77170

Please sign in to comment.