[ckan-changes] [okfn/ckan] d242bb: [#728] Add ckan.tracking_enabled to app_globals

GitHub noreply at github.com
Tue Apr 2 18:31:42 UTC 2013


  Branch: refs/heads/tracking-fixes
  Home:   https://github.com/okfn/ckan
  Commit: d242bb98a9af9b94c7ee760049aff91ddfde8c17
      https://github.com/okfn/ckan/commit/d242bb98a9af9b94c7ee760049aff91ddfde8c17
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-02 (Tue, 02 Apr 2013)

  Changed paths:
    M ckan/lib/app_globals.py

  Log Message:
  -----------
  [#728] Add ckan.tracking_enabled to app_globals

The ckan.tracking_enabled ini file setting was being ignored, so page
view tracking wasn't working. Adding ckan.tracking_enabled to
app_globals makes the setting work again.

Fixes #728


  Commit: 55129dbf959b060b27c68afce87486e5925e0b74
      https://github.com/okfn/ckan/commit/55129dbf959b060b27c68afce87486e5925e0b74
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2013-04-02 (Tue, 02 Apr 2013)

  Changed paths:
    M ckan/lib/cli.py

  Log Message:
  -----------
  [#729] Handle languages in URLs when updating page view tracking summary

Page view tracking was failing when a language was selected:

1. Put `ckan.tracking_enabled = true` in your ini file
2. Run CKAN, visit a page with a language e.g. `/en/dataset/annakarenina`
3. Run `paster tracking update`. If you look in your db, in the
   `tracking_summary` table there'll be a row with `package_id`
   `~~not~found~~`.
4. Run `paster tracking export tracking.csv`, the exported CSV file will
   say 0 views.

If you visit the page without the language in the URL e.g.
`/dataset/annakarenina` then run the export command again, the view does
get counted.

This commit fixes the SQL used by the `paster tracking update/export`
command to handle URLs with or without languages at the start.

Fixes #729


Compare: https://github.com/okfn/ckan/compare/d242bb98a9af^...55129dbf959b


More information about the ckan-changes mailing list