Skip to content

Commit

Permalink
log error in case of misuse of the audit decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
cahytinne committed Jul 29, 2015
1 parent 17e31d9 commit 046856c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions atramhasis/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
ConceptVisitLog
)
from pyramid.response import Response
import logging

log = logging.getLogger(__name__)


def _origin_from_request(request):
Expand Down Expand Up @@ -59,6 +62,8 @@ def advice(parent_object, *args, **kw):
concept_id=request.matchdict['c_id'],
conceptscheme_id=request.matchdict['scheme_id']
)
elif 'scheme_id' not in request.matchdict.keys():
log.error('Misuse of the audit decorator. The url must at least contain a {scheme_id} parameter')
else:
visit_log = ConceptschemeVisitLog(conceptscheme_id=request.matchdict['scheme_id'])
response = fn(parent_object, *args, **kw)
Expand Down

0 comments on commit 046856c

Please sign in to comment.