Skip to content

Commit

Permalink
[#2347] Fix race condition on updating the related view_count.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Murray committed Jul 16, 2012
1 parent 66aa4f1 commit 523c8f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckan/controllers/related.py
Expand Up @@ -74,7 +74,8 @@ def read(self, id):
if not related:
abort(404, _('The requested related item was not found'))

related.view_count += 1
related.view_count = model.Related.view_count + 1

model.Session.add(related)
model.Session.commit()

Expand Down

0 comments on commit 523c8f4

Please sign in to comment.