summaryrefslogtreecommitdiffstats
path: root/patchwork
Commit message (Collapse)AuthorAgeFilesLines
* patchwork/templates: Suppress cycle template tag warningHEADmasterJeremy Kerr2015-06-051-0/+2
| | | | | | | | | | | Running on django 1.7 gives a warning: RemovedInDjango18Warning: 'The `cycle` template tag is changing to escape its arguments; the non-autoescaping version is deprecated. Load it from the `future` tag library to start using the new behavior. Although this change doesn't affect this template, suppress the warning by loading from the future library. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* patchwork/views: request.REQUEST is deprecated in django 1.8Jeremy Kerr2015-06-052-5/+15
| | | | | | .. so do explicit accesses to request.GET or request.POST. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* patchwork/parser: Adapt for new unsaved-foreign-key behaviour in django 1.8Jeremy Kerr2015-06-051-6/+10
| | | | | | | | | | | | | | | | | | | | | | | Django 1.8 no longer supports assignment of unsaved models to ForeignKey fields: File "/home/jk/devel/patchwork/patchwork/tests/test_patchparser.py", line 75, in setUp (self.patch, self.comment) = find_content(self.project, email) File "/home/jk/devel/patchwork/patchwork/bin/parsemail.py", line 231, in find_content headers = mail_headers(mail)) File "/home/jk/devel/patchwork/lib/python/django/db/models/base.py", line 468, in __init__ setattr(self, field.name, rel_obj) File "/home/jk/devel/patchwork/lib/python/django/db/models/fields/related.py", line 668, in __set__ (value, self.field.rel.to._meta.object_name) ValueError: Cannot assign "<Patch: Test Subject>": "Patch" instance isn't saved in the database. Even though we'd be guaranteed to save the patch before the comment, we need to avoid this error. This change defers the assigment of Comment.patch until we know we have a saved Patch instance. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* patchwork: Add initial migrationsJeremy Kerr2015-06-052-0/+248
| | | | | | | | Add migrations for the patchwork app; these will be required for django-1.9, and are required to express the test dependencies (to the auth models) on 1.8. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* patchwork: Explicitly load states fixturesJeremy Kerr2015-06-0510-3/+29
| | | | | | | | | | | Apps with migrations will no longer load the initial_data fixtures by default. In order to prepare to add migrations to patchwork, rename the initial_data fixture to default_states (to match the default_tags fixture), and explicitly load them in tests that require them. Also, include this step in the INSTALL document. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* patchwork/views: prefetch delegate in generic_listJeremy Kerr2015-06-051-1/+1
| | | | | | | | If patches have a delegate, the patch list template will cause a query to render the delegate username. Instead, we should include the delegate in the select_related query. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* patchwork/models: Use OneToOneField for PatchChangeNotifcation.patchJeremy Kerr2015-06-041-1/+1
| | | | | | Same functionality, but we suppress an error from django 1.8+ Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parsemail: Don't catch all exceptions when a Project isn't foundJeremy Kerr2015-05-291-1/+1
| | | | | | | This is the first query that parsemail will do, and we don't want to lose any non-missing-project-related errors. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parsemail: run django.setup to initialise ModelsJeremy Kerr2015-05-291-0/+2
| | | | | | | From 1.7 onwards, we need to call django.setup() before we can use the Model interfaces. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests: Remove old-style test runner moduleJeremy Kerr2015-05-285-89/+45
| | | | | | | | | | | | | | | We get the following warning on django 1.7: System check identified some issues: WARNINGS: ?: (1_6.W001) Some project unittests may not execute as expected. HINT: Django 1.6 introduced a new default test runner. It looks like this project was generated using Django 1.5 or earlier. You should ensure your tests are all running & behaving as expected. See https://docs.djangoproject.com/en/dev/releases/1.6/#new-test-runner for more information. This change removes the unneeded base test module, and moves the patchparser doctests into a proper test module. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* cron: Move patchwork-cron script to a management commandJeremy Kerr2015-05-282-15/+20
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* patchwork/utils: Remove unnecessary MultiplePatchForm importJeremy Kerr2015-05-281-1/+0
| | | | | | It's not used in utils.py Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add patch tag infrastructureJeremy Kerr2015-05-2813-3/+427
| | | | | | | | | | | | | | | | | | | | | This change add patch 'tags', eg 'Acked-by' / 'Reviewed-by', etc., to patchwork. Tag parsing is implemented in the patch parser's extract_tags function, which returns a Counter object of the tags in a comment. These are stored in the PatchTag (keyed to Tag) objects associated with each patch. We need to ensure that the main patch lists do not cause per-patch queries on the Patch.tags ManyToManyField (this would result in ~500 queries per page), so we introduce a new QuerySet (and Manager) for Patch, adding a with_tag_counts() method to populate the tag counts in a single query. As users may be migrating from previous patchwork versions (ie, with no tag counts in the database), we add a 'retag' management command. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Update documentation and default settings to suit patchwork deployment modelJeremy Kerr2015-05-282-62/+58
| | | | | | | | | | | | We've always allowed configuration without altering any of the version-controlled files. With the recent settings changes, we have an extra level of indirection with the dev/prod settings modules. Since we have to edit a config file anyway, this change moves the prod.py settings file to a template, which is then used directly by mange.py (and the wsgi application). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* bin: Fix references to old settings module locationJeremy Kerr2015-05-271-1/+1
| | | | | | | Since the settings modules have changed locations, we need to update the parsemail script too. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Move to a more recent django project structureJeremy Kerr2015-05-27110-0/+12804
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>