[repository] new hook selector according to configuration's repairing flag stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 14 Jun 2011 13:46:36 +0200
branchstable
changeset 7500 cb0f4da64e86
parent 7499 96412cfc28e2
child 7501 2983dd24494a
[repository] new hook selector according to configuration's repairing flag
server/session.py
--- a/server/session.py	Tue Jun 14 13:43:36 2011 +0200
+++ b/server/session.py	Tue Jun 14 13:46:36 2011 +0200
@@ -74,6 +74,13 @@
     """
     return req.is_internal_session
 
+@objectify_selector
+def repairing(cls, req, **kwargs):
+    """repository side only selector returning 1 if the session is not a regular
+    user session but an internal session
+    """
+    return req.vreg.config.repairing
+
 
 class transaction(object):
     """context manager to enter a transaction for a session: when exiting the