Subversion Repositories SmartDukaan

Rev

Rev 18397 | Rev 18416 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18397 Rev 18412
Line 1941... Line 1941...
1941
def addUserToTable(userList,projectId):
1941
def addUserToTable(userList,projectId):
1942
    counter=0
1942
    counter=0
1943
    for i in userList:
1943
    for i in userList:
1944
        try:
1944
        try:
1945
            userId=i[1]
1945
            userId=i[1]
1946
            if counter==2:
1946
            if counter==20:
1947
                break
1947
                break
1948
            userPresent = session.query(UserCrmCallingData).filter_by(user_id=userId).order_by(desc(UserCrmCallingData.modified)).first()
1948
            userPresent = session.query(UserCrmCallingData).filter_by(user_id=userId).order_by(desc(UserCrmCallingData.modified)).first()
1949
            if userPresent is not None:
1949
            if userPresent is not None:
1950
                if userPresent.user_available==1:
1950
                if userPresent.user_available==1:
1951
                    if userPresent.project_id==projectId:
1951
                    if userPresent.project_id==projectId:
Line 1953... Line 1953...
1953
                    elif userPresent.modified>=(datetime.now().date()-timedelta(days=3)):
1953
                    elif userPresent.modified>=(datetime.now().date()-timedelta(days=3)):
1954
                        continue
1954
                        continue
1955
                else:
1955
                else:
1956
                    continue     
1956
                    continue     
1957
            counter=counter+1
1957
            counter=counter+1
-
 
1958
            lgr.info("Counter while adding",str(counter))
1958
            userMasterData = UserCrmCallingData()
1959
            userMasterData = UserCrmCallingData()
1959
            userMasterData.user_id = userId 
1960
            userMasterData.user_id = userId 
1960
            userMasterData.name =getUsername(userId) 
1961
            userMasterData.name =getUsername(userId) 
1961
            userMasterData.project_id = projectId
1962
            userMasterData.project_id = projectId
1962
            userMasterData.user_available=0
1963
            userMasterData.user_available=0