summaryrefslogtreecommitdiffstats
path: root/apps/patchwork/forms.py
Commit message (Collapse)AuthorAgeFilesLines
* Move to a more recent django project structureJeremy Kerr2015-05-271-237/+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>
* Resolve removed 'AUTH_PROFILE_MODULE' settingStephen Finucane2015-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'AUTH_PROFILE_MODULE' setting, and the 'get_profile()' method on the 'User' model are removed in Django 1.7. This causes errors when using Patchwork with Django 1.7+. There are three changes necessary: * Replace profile model's 'ForeignKey' with a 'OneToOneField' * Remove all 'get_profile()' calls * Delete 'AUTH_PROFILE_MODULE' settings from 'settings.py' These changes are discussed here: http://deathofagremmie.com/2014/05/24/retiring-get-profile-and-auth-profile-module/ Django 1.6 also introduces two other notable changes: * The 'XViewMiddleware' module has been moved * A new test runner has been introduced It is not possible to fix these issues without breaking compatibility with Django 1.5. As a result they have been ignored and must be resolved in a future release. Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* bundles: Don't allow slashes in bundle namesJeremy Kerr2013-04-201-1/+4
| | | | | | | | Because bundle names are used in URLs, we don't want slashes in them. Include a SQL migration script. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add email opt-out systemJeremy Kerr2011-04-141-1/+4
| | | | | | | | | | | 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-22/+21
| | | | | | | | | | 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>
* forms: Fix MultipleBooleanField.to_python when the field value is missingGuilherme Salgado2011-04-141-2/+2
| | | | | | | | | | | If you write a test for, say, the bundle form of a patch list, you'd still have to specify the 'no change' value to other form (e.g. the multiple update one) fields using MultipleBooleanField or else it'd raise a ValueError when field.clean() is called as part of form._get_errors(). Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views: Refactor generic_list() to make it less complicatedGuilherme Salgado2011-04-141-0/+1
| | | | | | | | | When a form is submitted it now delegates to separate processing functions according to the action. Apart from being more readable it's now a lot easier to add extra forms for processing lists of patches. Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* forms: Fix archiving/unarchiving of patches on patch listsGuilherme Salgado2011-03-081-0/+18
| | | | | | | | It was broken because MultipleBooleanField() was leaking string values instead of boolens as expected by MultiplePatchForm. Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Replace tab in indentation with spaceDirk Wallenstein2011-02-111-3/+3
| | | | | Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* forms: change MultiplePatchForm from a ModelForm to a FormJeremy Kerr2010-09-031-22/+9
| | | | | | | | | | | | | ModelForm was causing validation issues, especially with no-change fields on required model fields. Add a test for updating a required field (state) through MultiplePatchForm. Change it to a normal form, and call instance.setattr manually. This makes the new test pass. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* forms.MultiplePatchForm: remove no-change fields on clean()Jeremy Kerr2010-09-021-0/+15
| | | | | | | | | We need to remove no-change fields, as newer versions of django are checking for proper types on validation. Fixes MultipleUpdateTest. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* [packages] Fix bug with django 1.0Jeremy Kerr2008-10-101-0/+1
| | | | | | We needed an extra to_field_name Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* [packages] update to django 1.0Jeremy Kerr2008-10-101-0/+1
| | | | | | With a minor code change, and a small workaround. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* [views] Restructure profile view, simplify bundle accessJeremy Kerr2008-09-231-0/+5
| | | | | | | Make bundles more like todo lists - the list itself has its own page, accessible from the top user links. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Re-save user profile after setting nameJeremy Kerr2008-09-091-0/+5
| | | | | | | This means we get Person objects created with the correct name, rather than the username at time of creation. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* In some places tabs are used instead of spaces for indentation,Nate Case2008-08-231-4/+4
| | | | | | | | | | | 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>
* Use self.fields[field] rather than self.field when iterating form fieldsJeremy Kerr2008-08-231-2/+3
| | | | | | | This way, we included the delegate field added in the MultiplePatchForm's constructor. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Patchform.delegate isn't requiredJeremy Kerr2008-08-231-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Use django-registration infrastructureJeremy Kerr2008-08-221-42/+27
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* newforms is just 'forms' now.Jeremy Kerr2008-08-211-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Implement confirmation emails.Jeremy Kerr2008-08-211-1/+1
| | | | | | | To do this, we need to allow sucessive requests for the same confirmation URL. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Inital commitJeremy Kerr2008-08-211-0/+213
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>