Fix .isoformat() error in search logic - #875
Conversation
Co-authored-by: amirbiron <amirbiron@gmail.com>
|
Cursor Agent can help with this pull request. Just |
🧯 Dangerous deletes guard reportPolicy: see .cursorrules — dangerous deletions are blocked unless wrapped safely. Summary:
Flagged findings (file:line:snippet): Excluded matches (by path pattern): [...truncated, see workflow logs for full report] |
⏱️ Performance report(No performance test durations collected. Mark tests with |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
✨ תיאור קצר
תיקנתי שגיאת
AttributeError: 'str' object has no attribute 'isoformat'שהתרחשה בחיפוש הגלובלי (/api/search/global). הוספתי פונקציהsafe_isoשממירה תאריכים לפורמט ISO בצורה בטוחה, ומונעת קריסה כאשר הערך הוא כבר מחרוזת.📦 שינויים עיקריים
פירוט נקודות (רשימת תבליטים):
safe_isoלטיפול בטוח בהמרת תאריכים לפורמט ISO8601.logger.warningבתוךsafe_isoלתיעוד מקרים בהם מועבר ערך שאינוdatetime.POST /api/search/globalלשימוש ב־safe_isoעבור השדהupdated_atבתגובה.🧪 בדיקות
🧪 בדיקות נדרשות ב‑PR
📝 סוג שינוי
דוגמאות Conventional Commits
✅ צ'קליסט
🧩 השפעות/סיכונים
🔗 קישורים
🧯 סיכון / החזרה לאחור (Rollback)
Note
Replaces direct isoformat() with a robust safe_iso in global search response and introduces a module logger for warnings.
POST /api/search/global): Usesafe_isoforupdated_atserialization in response instead of calling.isoformat()directly inwebapp/app.py.safe_iso(value, field)to safely produce ISO8601 strings with graceful fallbacks and a warning on non-datetime values.loggervialogging.getLogger(__name__)and use it insidesafe_iso.Written by Cursor Bugbot for commit 843d434. This will update automatically on new commits. Configure here.