AnswerDotAI / AnswerDotAI/ghapi
HTTP Error 500: Internal Server Error when calling get_audit_log with "after" variable
- Lingua principale
- Python
- Stelle
- 685
- Fork
- 70
- Merge medio
- 1m
- PR unite (30g)
- 2
Descrizione
api.orgs.get_audit_log(ORG, per_page=10, page=2, after="2021-09-27T15:05:06+01:00")
// Here I'm using time format as per GHAPI rest docs. ghapi python docs suggest 2021-09-27 should work. Tried
// this and also timestamps, but all gave internal error.
If i remove the "after" variable, the call works fine.
I believe the problem is that the "after" variable is in [Link header format](api.orgs.get_audit_log(ORG, per_page=10, page=2, after="2021-09-27T15:05:06+01:00")) and perhaps this doesn't get autogenerated correctly.
Link: ; rel="next",
The value between after= and & does not completely URL + base64 decode to an obvious time format.
```
Signature:
api.orgs.get_audit_log(
org,
phrase=None,
include=None,
after=None,
before=None,
order=None,
per_page=None,
page=None,
)
Type: _GhVerb
String form:
orgs.get_audit_log(org, phrase=None, include=None, after=None, before=None, order=None, per_page=None, page=None)
https://docs.github.com/rest/reference/orgs#get-audit-log
File: /opt/conda/lib/python3.9/site-packages/ghapi/core.py
```
I would expect any values in the signature to specify the time format required, possibly add an example to the docs, and the error should be something less severe than a 500 internal error.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia in /opt/conda/lib/python3.9/site-packages/ghapi/core.py e confronta il modo in cui get_audit_log costruisce la richiesta con e senza l’argomento after. Controlla la documentazione dell’API audit-log di GitHub e riproduci la chiamata fornita usando i formati di data e timestamp documentati; il lavoro è completato quando il formato supportato viene gestito correttamente oppure il valore non valido produce un errore chiaro, con il formato previsto documentato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- github, python
- Ambito
- api
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100