aboutsummaryrefslogtreecommitdiffstats
path: root/app
Commit message (Collapse)AuthorAgeLines
* We're assuming feed urls without format suffixes should serve up atom/xml, ↵0.11.0.4hotfix/0.11.0.4Louise Crow2013-06-05-0/+3
| | | | so ignore any format from content negotiation in favour of that default.
* Merge branch 'release/0.11'0.11.0.3Louise Crow2013-06-04-953/+883
|\
| * Restore public body edit form.hotfix/0.11.0.1Louise Crow2013-06-03-1/+1
| |
| * Handle json requests for hidden info requests.Louise Crow2013-06-03-12/+19
| |
| * For non-HTML requests, just return the response code for now.Louise Crow2013-06-03-1/+4
| |
| * Merge branch 'feed-content-type' into rails-3-developMark Longair2013-05-30-1/+1
| |\
| | * Make sure Atom feeds are served with content type application/atom+xmlMark Longair2013-05-29-1/+1
| | | | | | | | | | | | Fixes #961
| * | Restore tabs to keep string for translation the same as previouslyLouise Crow2013-05-30-1/+1
| |/
| * Merge branch 'rails-3-develop' of ↵Louise Crow2013-05-29-2/+2
| |\ | | | | | | | | | ssh://git.mysociety.org/data/git/public/alaveteli into rails-3-develop
| | * Replace 'render_for_text data' with 'render :text => data'Mark Longair2013-05-28-2/+2
| | | | | | | | | | | | | | | | | | render_for_text no longer exists in Rails 3. Fixes #955
| * | When extracting attachments for an incoming message and getting the body of ↵Louise Crow2013-05-29-7/+16
| |/ | | | | | | the main part in order to look for uuencoded text, make sure that we're getting that main part from the reparsed attachments, and not getting an obsolete attachment. Fixes #958.
| * Only cache attachments that are returned with a 200 HTTP status codeMark Longair2013-05-24-1/+1
| | | | | | | | | | | | | | Otherwise redirects will be cached, and since headers and the status code aren't stored, a non-redirecting redirect page will be returned in the future, but with 200. It's easiest to only cache the 200 responses.
| * Check that display_filename matches URL part number or fallbackMark Longair2013-05-24-5/+29
| | | | | | | | | | | | | | | | | | | | | | If the display_filename of the attachment found from the URL part number doesn't match the passed in display_filename then the email may have been reparsed, causing a reordering. In that case, look to see if there is another attachment that uniquely matches that filename, and, if so, return that other attachment. If no matching uniquely matching filename is found, redirect to the incoming message, rather than returning a 404.
| * Refactor IncomingMessage.get_attachment_by_url_part_numberMark Longair2013-05-24-6/+1
| |
| * Move the mapi requires to where they're really neededMark Longair2013-05-22-2/+0
| | | | | | | | | | | | | | Handling of outlook-packed attachments would fail from rake tasks or in the console without requiring 'mapi/msg' and 'mapi/convert' beforehand. Instead, require them in the source file where they're actually used.
| * Avoid an FoiAttachment validation failure under Rails 3Mark Longair2013-05-16-0/+1
| | | | | | | | | | | | | | | | | | | | | | Under Rails 3, the uudecoded FoiAttachment in this test fails validation at the self.save! in IncomingMessage.parse_raw_email, although the FoiAttachment has been correctly created and saved to the database in _uudecode_and_save_attachments. Forcing a reload=true on self.foi_attachments fixes this. Thanks to Louise Crow for finding the fix for this problem.
| * Move "require 'alaveteli_file_types'" into the initializerMark Longair2013-05-16-4/+0
| |
| * Make efforts to ensure that we're usually dealing with UTF-8 stringsMark Longair2013-05-16-1/+6
| | | | | | | | | | | | | | | | | | One of these changes is to make sure that the Mail backend, like the TMail backend it replaces, will return text parts encoded in UTF-8 if possible. The other change is to ensure that when text attachments are reloaded from disk, we attempt to convert them to UTF-8.
| * Merge branch 'feature/restore-custom-error-pages' into rails-3-developLouise Crow2013-05-13-37/+28
| |\
| | * Add logging of any errors.Louise Crow2013-05-02-0/+4
| | |
| | * Remove now unused methodsLouise Crow2013-05-02-50/+0
| | |
| | * Handle routing errors with our custom template too.Louise Crow2013-05-02-1/+10
| | |
| | * Clearer setting of status code, addition of notification.Louise Crow2013-05-02-10/+17
| | |
| | * Return the correct status codes for ActiveRecord::RecordNotFound, ↵Louise Crow2013-05-02-0/+8
| | | | | | | | | | | | ActionController::UnknownAction, PermissionDenied and general exceptions.
| | * Add new error handler method that renders the general/exception_caught templateLouise Crow2013-05-02-0/+13
| | |
| * | Move angle brackets to within translation string to avoid double escaping ↵Louise Crow2013-05-08-1/+1
| | | | | | | | | | | | and to allow them to be replaced with suitable localised alternatives.
| * | Restore load of config (AlaveteliConfiguration is required in forward_on) - ↵Louise Crow2013-05-08-1/+1
| | | | | | | | | | | | update config to avoid redefinition of constant warnings.
| * | Encode parameters of Twitter linkMatthew Landauer2013-05-07-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | (reapplication of 3e2b161944cc4419002831d54c6bdfcd6aa30a01 as it seems to have been lost in a merge). No casting to string as there don't appear to be problems with the ':' character. Conflicts: app/views/request/_sidebar.html.erb
| * | Add markup of string lost in merging develop to rails-3-develop.Louise Crow2013-05-07-1/+1
| |/
| * Remove debian-specific require clause and use Gemfile to specify ↵Louise Crow2013-04-30-7/+0
| | | | | | | | non-standard require - bundler should be supplying the gem now.
| * Remove mailer patch methods that are no longer needed.Louise Crow2013-04-30-32/+0
| |
| * Mark ban text as html safeLouise Crow2013-04-25-1/+1
| |
| * Merge branch 'rails-3-develop' of ↵Louise Crow2013-04-24-0/+1
| |\ | | | | | | | | | ssh://git.mysociety.org/data/git/public/alaveteli into rails-3-develop
| | * Add encoding specifications to two files that use UTF-8Mark Longair2013-04-16-0/+1
| | | | | | | | | | | | | | | Both of these files include multi-byte UTF-8 sequences, so should have a 'magic comment' specifying the encoding.
| | * Fix the deadlock on dealing with incoming emailMark Longair2013-04-15-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #336 There was an occasional deadlock when two emails for the same request came in near-simultaneously; two processes would be started via script/mailin, each to deal with one email which are both updating the same InfoRequest. The error would look like: 2013-04-07 09:19:03 BST [13398]: [2-1] DETAIL: Process 13398 waits for ShareLock on transaction 36193647; blocked by process 13397. Process 13397 waits for ExclusiveLock on tuple (390,35) of relation 32918788 of database 32918687; blocked by process 13398. Process 13398: UPDATE "info_requests" SET "updated_at" = '2013-04-07 08:19:02.139515', "awaiting_description" = 't' WHERE "id" = 156200 Process 13397: UPDATE "info_requests" SET "updated_at" = '2013-04-07 08:19:02.143624', "awaiting_description" = 't' WHERE "id" = 156200 This arose from the following section of code: ActiveRecord::Base.transaction do raw_email = RawEmail.new incoming_message.raw_email = raw_email incoming_message.info_request = self incoming_message.save! raw_email.data = raw_email_data raw_email.save! self.awaiting_description = true params = { :incoming_message_id => incoming_message.id } if !rejected_reason.empty? params[:rejected_reason] = rejected_reason.to_str end self.log_event("response", params) self.save! end Matthew Somerville explained what was happening here in the issue report; to repeat his explanation from the bug report, both processes enter the transaction block and acquire a ShareLock on self with: incoming_message.info_request = self incoming_message.save! However, in order to update the self.awaiting_description field of the InfoRequest, with: self.awaiting_description = true [...] self.save! ... the ShareLock needs to be upgraded to an ExclusiveLock, but both will wait until the other's ShareLock is released, which would only happen at the end of the transaction. We can avoid this deadlock by using SELECT ... FOR UPDATE for the row in info_requests. In Rails 3.2.0 there is ActiveRecord support for this (via with_lock and lock! on a model instance) but so as not to require upgrading rails, I'm just using raw SQL.
| * | Merge branch 'release/0.9' into rails-3-developLouise Crow2013-04-24-100/+131
| |\ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Gemfile.lock app/controllers/public_body_controller.rb app/mailers/track_mailer.rb app/views/request/_hidden_correspondence.html.erb app/views/request/_sidebar.html.erb app/views/request/hidden.html.erb app/views/request/new_please_describe.html.erb app/views/request/preview.html.erb app/views/user/show.html.erb config/environment.rb config/routes.rb spec/controllers/public_body_controller_spec.rb
| * | Merge branch 'hotfix/0.8.0.1' into rails-3-developLouise Crow2013-04-02-2/+2
| |\ \ | | | | | | | | | | | | | | | | | | | | Conflicts: config/environment.rb spec/mailers/track_mailer_spec.rb
| * \ \ Merge remote-tracking branch ↵Louise Crow2013-03-28-46/+44
| |\ \ \ | | | | | | | | | | | | | | | 'openaustralia_github/small_source_code_header_fixups' into rails-3-develop
| | * | | Remove cvs tagMatthew Landauer2013-03-26-2/+0
| | | | |
| | * | | Change email address in header of source code to hello@mysociety.orgMatthew Landauer2013-03-26-44/+44
| | | | |
| * | | | Merge remote-tracking branch ↵Louise Crow2013-03-28-10/+10
| |\ \ \ \ | | | | | | | | | | | | | | | | | | 'openaustralia_github/request_action_admin_fixes' into rails-3-develop
| | * | | | Escaping fix in admin display of events params_yamlMatthew Landauer2013-03-28-1/+1
| | | | | |
| | * | | | Allow i18n of template email sent to users for vexatious requestsMatthew Landauer2013-03-28-6/+6
| | | | | |
| | * | | | Don't hardcode WhatDoTheyKnow.com in subject of email to usersMatthew Landauer2013-03-28-1/+1
| | | | | |
| | * | | | Fix link for showing user bounce messageMatthew Landauer2013-03-28-1/+1
| | | | | |
| | * | | | Forms were not being shown because using wrong form of erb blockMatthew Landauer2013-03-28-2/+2
| | |/ / /
| * / / / The configuration class was previously renamed from Configuration to ↵Matthew Landauer2013-03-28-1/+1
| |/ / / | | | | | | | | | | | | AlaveteliConfiguration
| * | | Update Configuration references to new name.Louise Crow2013-03-19-1/+1
| | | |
| * | | Merge branch 'develop' into rails-3-developLouise Crow2013-03-19-7/+10
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Gemfile Gemfile.lock app/views/admin_request/show.html.erb config/environment.rb
| * | | | Fix view for admin create authority. Block form of helper needs to return valueMatthew Landauer2013-03-19-3/+2
| | | | |