avoid error because of deleted data
This commit is contained in:
		
							parent
							
								
									5f8ed47165
								
							
						
					
					
						commit
						f5731c1e3f
					
				
					 2 changed files with 4 additions and 0 deletions
				
			
		|  | @ -64,6 +64,8 @@ class Responses(BaseRecordManager): | ||||||
|                 id += '.' + institutionId |                 id += '.' + institutionId | ||||||
|             if referrerId: |             if referrerId: | ||||||
|                 id += '.' + referrerId |                 id += '.' + referrerId | ||||||
|  |             if self.storage is None:    # may happen after deletions | ||||||
|  |                 return {} | ||||||
|             tracks = self.storage.getUserTracks(self.uid, 0, id) |             tracks = self.storage.getUserTracks(self.uid, 0, id) | ||||||
|             if not tracks:  # then try without institution |             if not tracks:  # then try without institution | ||||||
|                 tracks = self.storage.getUserTracks(self.uid, 0, personId) |                 tracks = self.storage.getUserTracks(self.uid, 0, personId) | ||||||
|  |  | ||||||
|  | @ -51,6 +51,8 @@ class BaseRecordManager(object): | ||||||
| 
 | 
 | ||||||
|     @Lazy |     @Lazy | ||||||
|     def storage(self): |     def storage(self): | ||||||
|  |         if self.context is None: | ||||||
|  |             return None | ||||||
|         records = self.loopsRoot.getRecordManager() |         records = self.loopsRoot.getRecordManager() | ||||||
|         if records is not None: |         if records is not None: | ||||||
|             return records.get(self.storageName) |             return records.get(self.storageName) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue