aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
Commit message (Collapse)AuthorAgeLines
...
| * Minor change to FoiAttachment#body_as_htmlGareth Rees2014-04-07-2/+1
| | | | | | | | AttachmentToHTML#to_html already returns the raw html now
| * Use AttachmentToHTML to generate FoiAttachment#body_as_htmlGareth Rees2014-03-28-77/+4
| |
* | Handle validation errors in PublicBody.import_csvGareth Rees2014-04-14-1/+9
| | | | | | | | | | | | | | | | | | Specifically using save! so that anything other than an ActiveRecord::RecordInvalid doesn't get missed Note that ActiveModel::Errors#full_messages includes the attribute key in the message. This is by design, so we should consider whether we can improve the way that we use translated validation messages.
* | Add missing validation to PublicBodyGareth Rees2014-04-14-0/+1
| | | | | | | | | | There's a unique index on public_bodies url_name, so we should have a validation for that.
* | Annotate modelsGareth Rees2014-04-09-24/+34
| | | | | | | | | | Should have been run after related migrations. Could automate this to always run after migrations.
* | Add default blank string to PublicBody@short_nameGareth Rees2014-04-09-1/+1
| | | | | | | | The validation allows a blank short_name but the schema does not.
* | Use more semantic allow_blank validationGareth Rees2014-04-09-1/+1
| |
* | Merge branch 'issues/1317-holding-pen-spam' into rails-3-developGareth Rees2014-04-07-0/+11
|\ \
| * | Add SpamAddress modelGareth Rees2014-03-26-0/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The volume of spam in the holding pen in WDTK has increased. Over a few weeks in January 2014 the pattern was roughly: - 8 were sent "To" the same address, which was a nearly valid old request address - correct hash, but missing the second hyphen. - 1 was sent "To" an invalid request address (nearly correct hash) - 1 was sent "BCC" a valid request address - 1 was sent "BCC" request@whatdotheyknow.com If a spam was sent "To" an old valid request address then it would be rejected. It's not entirely safe to just reject mails to old requests with any hash, because sometimes authorities miss out a digit in the request number, though perhaps simply getting a failure bounce would cause them to check. In any case that wouldn't trivially catch the most frequent case above as it doesn't have an obvious request number. --- We looked at greylisting and configuring the MTA with an RBL. Greylisting was rejected as it would slow down the responsiveness of the application when people email in. This could be revisited if/when emails are parsed through a queue system depending on how we find the performance there. An RBL is already configured, but this ticket refers more to where the email is sent rather than who it came from. --- We elected to: - Create spam_address model - Add code to RequestMailer.receive to check the list of spam addresses and silently discard an incoming mail if it's addressed to one of them - Add page to admin interface for adding/removing spam addresses --- Thanks to Ganesh Sittampalam for the research and Louise Crow for the implementation strategy.
* | Merge branch 'feature/1310-better-track-translation' into rails-3-developLouise Crow2014-04-04-80/+57
|\ \ | | | | | | | | | | | | Conflicts: spec/factories.rb
| * | Make public body update titles translatable.Louise Crow2014-03-24-2/+6
| | | | | | | | | | | | | | | This way the translators can control the order of elements in the sentence.
| * | Reformat for line length.Louise Crow2014-03-24-15/+31
| | |
| * | Remove CGI.escape calls.Louise Crow2014-03-24-12/+12
| | | | | | | | | | | | Escaping will happen automatically in Rails 3.
| * | Move track descriptions to a helper.Louise Crow2014-03-24-8/+1
| | | | | | | | | | | | We can access url generation methods more easily here.
| * | Use entire descriptions for searches rather than assembling.Louise Crow2014-03-24-51/+19
| | | | | | | | | | | | | | | Assembling from phrases makes the descriptions impossible to translate - just give complete descriptions for the most common cases.
| * | Remove unused variableLouise Crow2014-03-17-4/+0
| |/
* / Add honeypot spam protection to contact formGareth Rees2014-03-31-1/+1
|/ | | | | Intercepts the request and redirects to the homepage if the comment field is filled in on the contact form.
* Clean up translation interpolation syntax.Louise Crow2014-02-27-4/+5
| | | | | | Don't translate strings to be used in the admin interface - we're leaving it in English for now until we can markup the whole thing (#1353 and #1354). Use {{}} interpolation syntax where #{} was used in error.
* Merge remote-tracking branch ↵Louise Crow2014-02-24-15/+16
|\ | | | | | | 'opennewzealand_github/feature/encode-utf8-messages' into rails-3-develop
| * Add test for _get_attachment_text_internal with invalid utf-8Rowan Crawford2014-02-23-7/+8
| |
| * encode does no work if it thinks it's already utf-8 (even if invalid)Rowan Crawford2014-02-10-8/+8
| | | | | | | | Also use duck typing for whether we should use encode
* | Use HTTPS Google docs viewer where using HTTPS for alaveteliLouise Crow2014-02-17-1/+2
| |
* | Merge branch 'feature/batch-requests' into rails-3-developLouise Crow2014-01-29-6/+127
|\ \ | | | | | | | | | | | | | | | Conflicts: config/general.yml-example spec/factories.rb
| * | Send batch requests as a cron job.Louise Crow2013-12-04-0/+9
| | |
| * | Simplify return value, set sent_at in create_batch!Louise Crow2013-12-04-1/+4
| | |
| * | Display batch requests for user on 'my requests' pageLouise Crow2013-12-04-0/+1
| | | | | | | | | | | | This is the most rudimentary possible way to give them access to the batch request urls, pending #1239
| * | Use public bodies not requests in find_existingLouise Crow2013-12-04-4/+4
| | | | | | | | | | | | The requests may not have been created at this point.
| * | Split the creation of a batch and the associated requests.Louise Crow2013-12-04-17/+9
| | | | | | | | | | | | We're going to want to actually create and send the requests later.
| * | Add association between batches and public bodies.Louise Crow2013-12-04-0/+1
| | |
| * | Add the specific salutations to each request.Louise Crow2013-12-04-25/+51
| | | | | | | | | | | | | | | | | | Also, wrap model creation in a transaction and do the message sending separately - we may ultimately want to do this outside the request cycle.
| * | Move creation of batch to InfoRequestBatch.Louise Crow2013-12-04-0/+21
| | |
| * | Add check for double submission.Louise Crow2013-12-04-0/+12
| | |
| * | Make method names for finding existing objects clearerLouise Crow2013-12-04-3/+3
| | | | | | | | | | | | | | | They're not finding by the existing object, they're finding an existing object.
| * | Simple code for the happy pathLouise Crow2013-12-04-0/+14
| | | | | | | | | | | | | | | Create the batch and associate new requests with it, send the outgoing messages, and redirect to a page for the new batch.
| * | Add InfoRequestBatch model.Louise Crow2013-12-04-0/+27
| | | | | | | | | | | | | | | Re-annotate models. Index InfoRequestBatches by user - we'll display the batches for a user when they view their own requests.
| * | Batch users don't have a daily limit.Louise Crow2013-12-04-0/+3
| | | | | | | | | | | | | | | | | | | | | It doesn't make logical sense that they would. However I am preserving the ability to make batch requests as a separate thing from not having a daily limit - I think batch sending requires a (perhaps marginally) bigger level of trust.
| * | Create a placeholder salutation for a batch request template.Louise Crow2013-12-04-1/+5
| | |
| * | Handle the application of censor rules to a batch request template.Louise Crow2013-12-04-1/+4
| | |
| * | Add a batch_request_template flagLouise Crow2013-12-04-1/+6
| | | | | | | | | | | | | | | | | | A virtual attribute to use to customise some info request behaviours when we are using one request as a template for creating multiple requests.
* | | Merge branch 'feature/1176-automate-authority-contacts' into rails-3-developLouise Crow2014-01-28-0/+136
|\ \ \ | | | | | | | | | | | | | | | | Conflicts: doc/CHANGES.md
| * | | Populate admin public body forms based on a change request.Louise Crow2014-01-13-0/+33
| | | | | | | | | | | | | | | | | | | | Also add editable text for an email to be sent to the person requesting the change.
| * | | Clean up admin indexLouise Crow2014-01-13-0/+6
| | | | | | | | | | | | | | | | Refactor a bit so it's easier to read.
| * | | Form and models for asking for a public body change.Louise Crow2014-01-13-0/+97
| | |/ | |/|
* | | Merge branch 'feature/cache-request-lists' into rails-3-developLouise Crow2014-01-28-0/+21
|\ \ \
| * | | Cache frequently accessed request lists.Louise Crow2013-12-19-0/+17
| | | | | | | | | | | | | | | | Make specs a bit more focused, remove view specs - they're not relevant to the new code in their current form and don't seem to merit updating.
| * | | Move make_query_from_params to XapianQueriesLouise Crow2013-12-19-0/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | This is involved with the construction of meaningful xapian queries with respect to InfoRequestEvents. This commit also removes the get_tags_from_params method, which presumably was targeted at PublicBodies, but doesn't seem to actually be used anywhere. XapianQueries is used to extend InfoRequestEvent in order to prevent InfoRequestEvent becoming too unwieldy and to preserve the association between these methods.
* | | Merge branch 'feature/1269-improve-quoting-recognition' into rails-3-developLouise Crow2014-01-27-0/+4
|\ \ \
| * | | Handle gmail-style quoting from the HTML part of a mail.Louise Crow2014-01-22-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We already handled this type of quoting when coming directly from a text part of a mail, but when we choose the HTML part as the main part and then convert it to text, the 'On [date] <email> person said:' part can get split over two lines.
* | | | Merge remote-tracking branch 'origin/translatable-report-reasons' into ↵Louise Crow2014-01-27-2/+6
|\ \ \ \ | | | | | | | | | | | | | | | rails-3-develop
| * | | | The reasons for making a report need to be translatableMark Longair2014-01-02-2/+6
| | |/ / | |/| | | | | | | | | | Thanks to György Peng for pointing out this omission.