Commit graph

20 commits

Author SHA1 Message Date
Henrik Levkowetz 457821f16f Updated a middleware function to use the correct Py3 idiom to access exception arguments.
- Legacy-Id: 18504
2020-09-21 12:39:00 +00:00
Henrik Levkowetz 726fcbf27d Removed all __future__ imports.
- Legacy-Id: 17391
2020-03-05 23:53:42 +00:00
Henrik Levkowetz 2d7c9629aa Added 'from __future__' imports all over the place, to bring code behaviour into closer alignment between python2 and python3
- Legacy-Id: 16446
2019-07-15 15:40:51 +00:00
Henrik Levkowetz 3ec7e864be Converted leading tabs to spaces in ietf/**/*.py
- Legacy-Id: 16310
2019-06-27 14:51:02 +00:00
Henrik Levkowetz d7f5c84182 Initial 2to3 patch with added copyright statement updates.
- Legacy-Id: 16309
2019-06-27 14:40:54 +00:00
Henrik Levkowetz 7385a8be51 Changed name and signature for a log helper.
- Legacy-Id: 13571
2017-06-09 19:38:48 +00:00
Henrik Levkowetz b2da91de1b Added a middleware exception handler for the case of people submitting unicode outside the Basic Multilingual Plane, which cannot currently be saved to the database.
- Legacy-Id: 13508
2017-06-03 21:47:51 +00:00
Henrik Levkowetz 7f607c51d2 Changed from old-style to new-style middleware.
- Legacy-Id: 12824
2017-02-12 17:07:48 +00:00
Henrik Levkowetz aa5e61d958 Updated all urlpatterns to use ietf.utils.urls.url() instead of django's,
in order to autogenerate dotted path url pattern names.  Updated a number
of url reverses to use dotted path, and removed explicit url pattern names
as needed.

Changed some imports to prevent import of ietf.urls before django
initialization was complete.


Changed 3 cases of form classes being curried to functions; django 1.10
didn't accept that.

Started converting old-style middleware classes to new-style middleware
functions (incomplete).

Tweaked a nomcom decorator to preserve function names and attributes, like
a good decorator should.

Replaced the removed django templatetag 'removetags' with our own version
which uses bleach, and does sanitizing in addition to removing explicitly
mentionied html tags.

Rewrote the filename argument handling in a management command which had
broken with the upgrade.
 - Legacy-Id: 12818
2017-02-11 14:43:01 +00:00
Henrik Levkowetz 7b95411f58 The context_instance parameter to render_to_response() and render_to_string() is now deprecated. Fixed this, and generally changed the idiom render_to_response('template.html', {}, RequestContext(request)) to the newer and simpler render(request, 'template.html', {}). About 200 instances.
- Legacy-Id: 12637
2017-01-09 21:26:30 +00:00
Ole Laursen b334550d9c Summary: Get rid of FillInRemoteUserIfLoggedInMiddleware, we are not
using Apache/REMOTE_USER to login anymore, and it's forcing a vary:
cookie header even on pages that don't check on the logged in user
(i.e. things not rendering through the base template)
 - Legacy-Id: 9075
2015-02-12 15:16:29 +00:00
Henrik Levkowetz 02031a01b9 Cleaned out some (arbitrary) submodule name imports into ietf.utils, and made the corresponding import statements import the names directly from the correct submodules.
- Legacy-Id: 7495
2014-03-16 07:09:38 +00:00
Henrik Levkowetz 5bef5d11ae Made doc/ pyflakes-clean.
- Legacy-Id: 7462
2014-03-15 16:09:47 +00:00
Henrik Levkowetz 9ea9ba1d66 Merged in [7138] from rjsparks@nostrum.com:
Reworked SMTP Exception handling, adding sending a ticket to the secretariat when there are errors handing messages off for delivery.
Added SMTP exception handling to send-scheduled-mail.
This is related to ticket #1208
 - Legacy-Id: 7256
Note: SVN reference [7138] has been migrated to Git commit 64727c1c33
2014-02-17 18:55:37 +00:00
Ole Laursen e2554a6a0c It turns out that Django resetting the user if REMOTE_USER is not passed in is a problem on live to, so switch the whole code base to using the middleware to set REMOTE_USER from the logged in user if not passed in from the outside
- Legacy-Id: 7167
2014-01-24 14:30:00 +00:00
Henrik Levkowetz e1a7bf92ff Added logging for mail sending problems.
- Legacy-Id: 5489
2013-03-06 19:36:06 +00:00
Henrik Levkowetz 266b7820d0 Merged from log:branch/2.00@2363: Current release branch head to trunk.
- Legacy-Id: 2365
2010-07-21 12:48:05 +00:00
Henrik Levkowetz cd030d3b43 Adding copyright notices to all python files
- Legacy-Id: 716
2007-06-27 21:16:34 +00:00
Bill Fenner cae902a373 Add two middleware classes:
- SQLLogMiddleware.  This logs any INSERT or UPDATE performed by
a request.

- SMTPExceptionMiddleware.  This renders a "please try again"
(template email_failed.html) message when an attempt to send
email failed.  This uses a bit of a hack, in that the middleware
looks explicitly for smtplib.SMTPException, and smtplib can
raise other exceptions (particularly socket errors).  utils/mail/send_smtp
catches all exceptions and reraises non-smtplib exceptions as
fake smtplib exceptions, and the middleware undoes the wrapping.
 - Legacy-Id: 224
2007-06-04 13:52:34 +00:00
Henrik Levkowetz 80829985a0 Added prettifying middleware (from djangosnippet 172)
- Legacy-Id: 103
2007-05-06 05:14:25 +00:00