summaryrefslogtreecommitdiffstats
path: root/apps/patchwork/views/base.py
Commit message (Collapse)AuthorAgeFilesLines
* Move to a more recent django project structureJeremy Kerr2015-05-271-122/+0
| | | | | | | | | | This change updates patchwor to the newer project struture: we've moved the actual application out of the apps/ directory, and the patchwork-specific templates to under the patchwork application. This gives us the manage.py script in the top-level now. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views: Replace 'mimetype' with 'content_type'Stephen Finucane2015-05-031-3/+3
| | | | | | | | | | | | | | Passing 'mimetype' to 'HttpResponse' is deprecated in 1.6 and removed in Django 1.7. Among other things, this causes some unit tests to fail when using Django 1.7. Its replacement - 'content_type' - is available in Django 1.5+. This can be seen here: https://docs.djangoproject.com/en/1.5/ref/request-response/#django.http.HttpResponse.__init__ This is therefore a like-for-like replacement. Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add a config option to FORCE_HTTPS_LINKSKonstantin Ryabitsev2013-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | In situations where SSL is terminated at the load-balancer, we cannot rely on guessing the scheme based on whether patchwork itself was accessed via http or https, since the last-leg is always going to be done over http. Unfortunately, wrongly using http:// URLs results in unusable .pwclientrc files, since xmlrpc does not handle http->https redirects and instead displays a traceback. This change introduces a FORCE_HTTPS_LINKS option, which forces pwclientrc links to always return "https" regardless of how the project itself is accessed. It appears that the http/https check is currently only used for generating pwclientrc -- a lot of other places seem to hardcode "http://" and rely on the server to transparently upgrade the connection. This is not a secure approach (it allows for MITM and SSL-Strip attacks) and therefore all places currently hardcoding http://{{site.domain}} and similar should be switched to using the "sheme" variable, the same as done for generating pwclientrc files. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views/base: Implement limit for submitter autocompletionJeremy Kerr2013-10-131-5/+18
| | | | | | | Add a limit parameter to the completion view, and pass a limit of 20 results in the javascript. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views/base: Include email addresses in submitter autocomplete searchJeremy Kerr2013-10-131-1/+3
| | | | | | | | Currently, we only search names, which is a problem for Person objects with only an email address set. This change includes the email addresses in the search. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add email opt-out systemJeremy Kerr2011-04-141-1/+3
| | | | | | | | | | | We're going to start generating emails on patchwork updates, so firstly allow people to opt-out of all patchwork communications. We do this with a 'mail settings' interface, allowing non-registered users to set preferences on their email address. Logged-in users can do this through the user profile view. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* registration: use EmailConfimation rather than separate registration appJeremy Kerr2011-04-141-0/+1
| | | | | | | | | | Since we have infrastructure for email confirmations, we no longer need the separate registration app. Requires a migration script, which will delete all inactive users, including those newly added and pending confirmation. Use carefully. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Use generic email confirmation objectJeremy Kerr2011-04-141-1/+23
| | | | | | | | | | | | | Rather than having a UserPerson-specific confirmation, add an EmailConfirmation object to allow multiple types of confirmations (eg, opt-out requests in future). To do this, we use a view (patchwork.views.confirm) that will call the type-specific view with the confirmation object. Also, add tests to check that the User/Person linkage system works. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Use the 'in' operator instead of dict.has_key(), which has been deprecatedGuilherme Salgado2011-03-301-1/+1
| | | | | Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Remove unused importsGuilherme Salgado2011-03-151-5/+0
| | | | | | | | | This is so that we can use static analysis tools like pyflakes to find undefined names (and other common mistakes we often make) without being swamped with unused imports warnings. Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views: Use request scheme in sample pwclientrc file.Jeremy Kerr2010-03-191-0/+4
| | | | | | Adapt the pwclientrc file to suit the current scheme in use. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views: separate project views into separate fileJeremy Kerr2009-04-051-14/+0
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Use 'from' import for urlresolversJeremy Kerr2009-01-071-3/+2
| | | | | | | Some python installs can't seem to find the fully-qualified module, so use the 'from'-style import instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Rename pwclient.py to pwclientJeremy Kerr2008-09-091-2/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Make pwclient visible thorugh site, and add .pwclientrc infrastructureJeremy Kerr2008-09-081-1/+14
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Set content-disposition header for pwclientrcJeremy Kerr2008-09-081-3/+5
| | | | | | So that browsers will save, rather than view. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add pwclientrc configuration file sample for each projectJeremy Kerr2008-09-081-0/+8
| | | | | | | This allows users to easily configure pwclient for a patchwork instance. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* In some places tabs are used instead of spaces for indentation,Nate Case2008-08-231-3/+3
| | | | | | | | | | | even when other lines of a method are indented with spaces. This gets rid of all tabs and uses spaces everywhere. [Reworked to apply on newer code by Jeremy] Signed-off-by: Nate Case <ncase@xes-inc.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add simple help infrastructure, with an 'about' page.Jeremy Kerr2008-08-231-1/+10
| | | | | | | We'll need the about page for adding attribution for included components. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Use django-registration infrastructureJeremy Kerr2008-08-221-2/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Inital commitJeremy Kerr2008-08-211-0/+66
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>