Commit a4c33bde authored by Rafael Monnerat's avatar Rafael Monnerat

Update upstream/master

parents 0cf19127 da7a6e26
<property_sheet_list>
<portal_type id="Account Type Constraint">
<item>ConstraintType</item>
</portal_type>
<portal_type id="Accounting Transaction">
<item>AccountingTransactionConstraint</item>
</portal_type>
<portal_type id="Accounting Transaction Balance Constraint">
<item>ConstraintType</item>
</portal_type>
<portal_type id="Accounting Transaction Line">
<item>AccountingTransactionLineConstraint</item>
</portal_type>
......
Account Type Constraint | ConstraintType
Accounting Transaction Balance Constraint | ConstraintType
Accounting Transaction Line | AccountingTransactionLineConstraint
Accounting Transaction | AccountingTransactionConstraint
Balance Transaction Line | AccountingTransactionLineConstraint
......
<property_sheet_list>
<portal_type id="Missing Category Document Constraint">
<item>ConstraintType</item>
</portal_type>
</property_sheet_list>
\ No newline at end of file
Missing Category Document Constraint | ConstraintType
\ No newline at end of file
import json
import oauth2client.client
import oauth2client.transport
from Products.ERP5Security.ERP5ExternalOauth2ExtractionPlugin import getGoogleUserEntry
from zExceptions import Unauthorized
SCOPE_LIST = ['https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/userinfo.email']
# Default timeout (in seconds) for the HTTP request made to google servers to
# exchange the authorization code for a token.
DEFAULT_HTTP_TIMEOUT = 10
def _getGoogleClientIdAndSecretKey(portal, reference="default"):
......@@ -33,7 +37,7 @@ def redirectToGoogleLoginPage(self):
include_granted_scopes="true")
self.REQUEST.RESPONSE.redirect(flow.step1_get_authorize_url())
def getAccessTokenFromCode(self, code, redirect_uri):
def getAccessTokenFromCode(self, code, redirect_uri, timeout=DEFAULT_HTTP_TIMEOUT):
client_id, secret_key = _getGoogleClientIdAndSecretKey(self.getPortalObject())
flow = oauth2client.client.OAuth2WebServerFlow(
client_id=client_id,
......@@ -42,7 +46,9 @@ def getAccessTokenFromCode(self, code, redirect_uri):
redirect_uri=redirect_uri,
access_type="offline",
include_granted_scopes="true")
credential = flow.step2_exchange(code)
credential = flow.step2_exchange(
code,
http=oauth2client.transport.get_http_object(timeout=timeout))
credential_data = json.loads(credential.to_json())
return credential_data
......
......@@ -15,6 +15,9 @@
<item>DefaultImage</item>
<item>Reference</item>
</portal_type>
<portal_type id="Resource Measures Consistency Constraint">
<item>ConstraintType</item>
</portal_type>
<portal_type id="Service Individual Variation">
<item>DefaultImage</item>
</portal_type>
......
......@@ -4,5 +4,6 @@ Measure Cell | Amount
Product Individual Variation | DefaultImage
Product Individual Variation | Reference
Product | DefaultImage
Resource Measures Consistency Constraint | ConstraintType
Service Individual Variation | DefaultImage
Supply Cell | Reference
\ No newline at end of file
......@@ -6,6 +6,9 @@
<portal_type id="Delivery Node">
<item>DeliveryNode</item>
</portal_type>
<portal_type id="Duplicate Inventory Constraint">
<item>ConstraintType</item>
</portal_type>
<portal_type id="Internal Packing List">
<item>DeliveryCausalityStateConstraint</item>
</portal_type>
......@@ -31,6 +34,9 @@
<portal_type id="Sale Trade Condition">
<item>PaymentCondition</item>
</portal_type>
<portal_type id="Trade Model Line Cell Consistency Constraint">
<item>ConstraintType</item>
</portal_type>
<portal_type id="Trade Model Path">
<item>PaymentCondition</item>
</portal_type>
......
Business Process | Reference
Business Process | Version
Delivery Node | DeliveryNode
Duplicate Inventory Constraint | ConstraintType
Internal Packing List | DeliveryCausalityStateConstraint
Inventory Report | Arrow
Inventory Report | InventoryReport
......@@ -10,4 +11,5 @@ Returned Sale Packing List | DeliveryCausalityStateConstraint
Sale Order | PaymentCondition
Sale Packing List | DeliveryCausalityStateConstraint
Sale Trade Condition | PaymentCondition
Trade Model Line Cell Consistency Constraint | ConstraintType
Trade Model Path | PaymentCondition
\ No newline at end of file
......@@ -774,7 +774,8 @@ CREATE TABLE %s (
b" processing_node=0 AND"
b" %s%s"
b" ORDER BY priority, date"
b" LIMIT %i" % args,
b" LIMIT %i"
b" FOR UPDATE" % args,
0,
))
else:
......@@ -787,6 +788,7 @@ CREATE TABLE %s (
b" %s%s"
b" ORDER BY priority, date"
b" LIMIT %i"
b" FOR UPDATE"
b")" % args).format
result = Results(query(
b"SELECT *"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment