- Timestamp:
- 18 Nov 2014, 11:37:28 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/customer.py
r11964 r11985 46 46 RE_CUSTID_NON_NUM = re.compile('[^\d]+') 47 47 48 48 49 class Customer(grok.Container): 49 50 """This is a customer container for the various objects … … 76 77 'password'] = passwordmanager.encodePassword(password) 77 78 self.temp_password['user'] = user 78 self.temp_password['timestamp'] = datetime.utcnow() # offset-naive datetime79 self.temp_password['timestamp'] = datetime.utcnow() # offset-naive datetime 79 80 80 81 def getTempPassword(self): 81 82 """Check if a temporary password has been set and if it 82 is not expired. 83 is not expired. 83 84 84 85 Return the temporary password if valid, … … 147 148 Customer = attrs_to_fields(Customer) 148 149 150 149 151 class CustomerFactory(grok.GlobalUtility): 150 152 """A factory for customers. … … 160 162 def getInterfaces(self): 161 163 return implementedBy(Customer) 164 162 165 163 166 @grok.subscribe(ICustomer, grok.IObjectAddedEvent) … … 177 180 IWorkflowInfo(customer).fireTransition('create') 178 181 return 182 179 183 180 184 def path_from_custid(customer_id): … … 215 219 return folder_name 216 220 221 217 222 def move_customer_files(customer, del_dir): 218 223 """Move files belonging to `customer` to `del_dir`. … … 242 247 return 243 248 249 244 250 def update_customer_deletion_csvs(customer, del_dir): 245 251 """Update deletion CSV files with data from customer. … … 262 268 263 269 # append a deletion timestamp on each data row 264 timestamp = str(now().replace(microsecond=0)) # store UTC timestamp270 timestamp = str(now().replace(microsecond=0)) # store UTC timestamp 265 271 for num, row in enumerate(csv_data[1:-1]): 266 272 csv_data[num+1] = csv_data[num+1] + ',' + timestamp … … 276 282 open(csv_path, 'a').write('\r\n'.join(csv_data[1:])) 277 283 return 284 278 285 279 286 @grok.subscribe(ICustomer, grok.IObjectRemovedEvent) … … 320 327 CUSTOMER_FILE_STORE_NAME = 'file-customer' 321 328 329 322 330 class CustomerFileNameChooser(grok.Adapter): 323 331 """A file id chooser for :class:`Customer` objects. … … 410 418 # call super method to ensure that any old files with 411 419 # different filename extension are deleted. 412 file, path, file_obj = 420 file, path, file_obj = super( 413 421 CustomerFileStoreHandler, self).createFile( 414 422 store, root, filename, file_id, file)
Note: See TracChangeset for help on using the changeset viewer.