mirror of
https://github.com/bugsink/bugsink.git
synced 2026-01-05 21:00:13 -06:00
Various fixes after visiting the running server
(it's been a while)
This commit is contained in:
@@ -112,11 +112,11 @@ class BaseIngestAPIView(APIView):
|
||||
|
||||
if issue_created:
|
||||
if ingested_event.project.alert_on_new_issue:
|
||||
send_new_issue_alert.delay(issue)
|
||||
send_new_issue_alert.delay(issue.id)
|
||||
|
||||
elif issue_is_regression(issue, event.release): # new issues cannot be regressions by definition, hence 'else'
|
||||
if ingested_event.project.alert_on_regression:
|
||||
send_regression_alert.delay(issue)
|
||||
send_regression_alert.delay(issue.id)
|
||||
|
||||
IssueStateManager.reopen(issue)
|
||||
|
||||
@@ -171,5 +171,5 @@ class IngestEnvelopeAPIView(BaseIngestAPIView):
|
||||
"""
|
||||
|
||||
event = request.data[2]
|
||||
self.process_event(event, request, project)
|
||||
self.process_event(event, project, request)
|
||||
return Response()
|
||||
|
||||
@@ -22,5 +22,5 @@ class IssueAdmin(admin.ModelAdmin):
|
||||
]
|
||||
|
||||
def event_count(self, obj):
|
||||
return str(obj.events.count())
|
||||
return str(obj.event_set.count())
|
||||
event_count.short_description = "Event count"
|
||||
|
||||
@@ -30,7 +30,7 @@ class Issue(models.Model):
|
||||
|
||||
def parsed_data(self):
|
||||
# TEMP solution; won't scale
|
||||
return json.loads(self.events.first().data)
|
||||
return json.loads(self.event_set.first().data)
|
||||
|
||||
def get_main_exception(self):
|
||||
# TODO: refactor (its usages) to a (filled-on-create) field
|
||||
@@ -48,7 +48,7 @@ class Issue(models.Model):
|
||||
# although you may also care about the root cause. (In fact, sometimes you care more about the root cause,
|
||||
# but I'd say you'll have to yak-shave your way there).
|
||||
|
||||
parsed_data = json.loads(self.events.first().data)
|
||||
parsed_data = json.loads(self.event_set.first().data)
|
||||
exc = parsed_data.get("exception", {"values": []})
|
||||
values = exc["values"] # required by the json spec, so can be done safely
|
||||
return values[-1] if values else {}
|
||||
|
||||
@@ -21,7 +21,7 @@ def issue_list(request, project_id):
|
||||
|
||||
def issue_last_event(request, issue_pk):
|
||||
issue = get_object_or_404(Issue, pk=issue_pk)
|
||||
last_event = issue.events.order_by("timestamp").last()
|
||||
last_event = issue.event_set.order_by("timestamp").last()
|
||||
|
||||
return redirect(issue_event_detail, issue_pk=issue_pk, event_pk=last_event.pk)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user