Subversion Repositories SmartDukaan

Rev

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

Rev 1249 Rev 1273
Line 3... Line 3...
3
 
3
 
4
@author: ashish
4
@author: ashish
5
'''
5
'''
6
from shop2020.model.v1.user.impl import Dataservice
6
from shop2020.model.v1.user.impl import Dataservice
7
from shop2020.utils.Utils import log_entry, to_py_date, to_java_date
7
from shop2020.utils.Utils import log_entry, to_py_date, to_java_date
8
from shop2020.model.v1.user.impl.Dataservice import User, IPMap,\
8
from shop2020.model.v1.user.impl.Dataservice import User, UserCommunication, IPMap,\
9
    Address, SocialHandle, UserState, InternalInfo, SocialService
9
    Address, SocialHandle, UserState, InternalInfo, SocialService
10
from shop2020.thriftpy.model.v1.user.ttypes import UserContextException,\
10
from shop2020.thriftpy.model.v1.user.ttypes import UserContextException,\
11
    AuthenticationException, AccountStatus, Sex
11
    AuthenticationException, AccountStatus, Sex
12
from shop2020.clients.HelperClient import HelperClient
12
from shop2020.clients.HelperClient import HelperClient
13
from elixir import session
13
from elixir import session
Line 239... Line 239...
239
        user.password = get_db_password(new_password)
239
        user.password = get_db_password(new_password)
240
        session.commit()
240
        session.commit()
241
        return True
241
        return True
242
    else:
242
    else:
243
        return False
243
        return False
-
 
244
 
-
 
245
 
-
 
246
def create_user_communication(user_id, email, communication_type, order_id, awb, product, subject, message):
-
 
247
 
-
 
248
    user_communication = UserCommunication()
-
 
249
    user_communication.user_id = user_id
-
 
250
    user_communication.communication_type = communication_type
-
 
251
    user_communication.order_id = order_id
-
 
252
    user_communication.airwaybill_no = awb
-
 
253
    user_communication.reply_to = email
-
 
254
    user_communication.product_name = product
-
 
255
    user_communication.subject = subject
-
 
256
    user_communication.message = message
-
 
257
#    user_communication.added_at = user_communication_to_save.added_at
-
 
258
    session.commit()
244
    
259
    
245
def get_address(address_id):
260
def get_address(address_id):
246
    address = Address.get_by(id=address_id)
261
    address = Address.get_by(id=address_id)
247
    return address
262
    return address
248
 
263