-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Events #525
Conversation
…gdescription accordingly
…n_body in Event model, FIX: retrieve method in events.views to check for VerE permission in the verification_body
…rovided, FIX : try except error for trying to change request.data in events.views.py FIX : returning fields in EventSerializer and EventFullSerializer, ADD : Method to fetch the ids of the verifying bodies using the multiselectfield option
ADD : Check on email verified on backend
Events new
Host email for event changed
return Response({"success": "Mail sent successfully"}) | ||
except Exception as e: | ||
return Response( | ||
{"error_status": True, "msg": f"Error sending mail: {str(e)}"} |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 2 months ago
To fix the problem, we need to ensure that the detailed exception message is not exposed to the user. Instead, we should log the detailed error message on the server and return a generic error message to the user. This can be achieved by modifying the exception handling code to log the error and return a generic message.
- Import the
logging
module to enable logging of error messages. - Replace the line that returns the detailed exception message with a line that logs the error and returns a generic error message.
-
Copy modified line R19 -
Copy modified line R258 -
Copy modified line R260
@@ -18,2 +18,3 @@ | ||
from locations.helpers import create_unreusable_locations | ||
import logging | ||
|
||
@@ -256,4 +257,5 @@ | ||
except Exception as e: | ||
logging.error(f"Error sending mail: {str(e)}") | ||
return Response( | ||
{"error_status": True, "msg": f"Error sending mail: {str(e)}"} | ||
{"error_status": True, "msg": "An internal error has occurred while sending mail."} | ||
) |
No description provided.