Public » FogBugz Middleware
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

kill trialing newlines

Changeset 9243721f7373

Parent 957068b4dfc4

by Profile picture of Benjamin PollackBenjamin Pollack

Changes to one file · Browse files at 9243721f7373 Showing diff from parent 957068b4dfc4 Diff from another changeset...

 
12
13
14
15
 
16
17
18
 
23
24
25
26
 
27
28
29
30
31
32
33
 
34
35
36
37
38
39
 
40
41
42
 
47
48
49
50
 
51
52
53
54
55
56
 
57
58
59
 
12
13
14
 
15
16
17
18
 
23
24
25
 
26
27
28
29
30
31
32
 
33
34
35
36
37
38
 
39
40
41
42
 
47
48
49
 
50
51
52
53
54
55
 
56
57
58
59
@@ -12,7 +12,7 @@
  and forwards them to FogBugz' ScoutSubmit form. It will then   allow processing to continue--meaning that if you have Django   set to send an email on error, it will continue to do so.""" - +   def process_response(self, request, response):   if response.status_code == 404:   if settings.FOGBUGZ_REPORT_BROKEN_LINKS: @@ -23,20 +23,20 @@
  if referer and not _is_ignorable_404(path) and is_internal:   ua = request.META.get('HTTP_USER_AGENT', '<none>')   ip = request.META.get('REMOTE_ADDR', '<none>') - +   bug = {'ScoutUserName': settings.FOGBUGZ_USERNAME,   'ScoutProject': settings.FOGBUGZ_PROJECT,   'ScoutArea': settings.FOGBUGZ_AREA,   'Description': 'Broken %slink %s on %s' % ((is_internal and 'INTERNAL ' or ''), request.path, domain),   'Extra': 'Referrer: %s\nRequested URL: %s\nUser agent:%s\nIP address: %s\n' \   % (referer, request.get_full_path(), ua, ip)} - +   try:   urllib2.urlopen(settings.FOGBUGZ_URL, urllib.urlencode(bug))   except:   pass   return response - +   def process_exception(self, request, exception):   # Do not file 404 errors in FogBugz   if isinstance(exception, Http404): @@ -47,13 +47,13 @@
  bug["ScoutProject"] = settings.FOGBUGZ_PROJECT   bug["ScoutArea"] = settings.FOGBUGZ_AREA   bug["Description"] = '%s error: %s at %s' % ((request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS and 'Internal' or 'External'), exception.__class__.__name__, request.path) - +   try:   request_repr = repr(request)   except:   request_repr = 'Request repr() unavailable'   bug["Extra"] = '%s\n\n%s' % (_get_traceback(sys.exc_info()), request_repr) - +   try:   urllib2.urlopen(settings.FOGBUGZ_URL, urllib.urlencode(bug))   except: