Skip to content

Fix crash when defining a new authority during onboarding

Mateusz Żebrak requested to merge mzebrak/fixes into develop

Previously it was possible to get an NoWorkingAccountError exception due to typo in the reference to profile_data.

 /home/dev/1_workspace/clive/clive/__private/ui/manage_authorities/new_authority.py:128 in __private_key_already_exists                    
                                                                                                                                           
   125          return                                                                                                                  
   126                                                                                                                                   
   127       def __private_key_already_exists() -> bool:                                                                                 
  128          return private_key.without_alias() in self.app.world.profile_data.working_ac                                            
   129                                                                                                                                   
   130       if not self.context.working_account.keys.is_public_alias_available(private_key.a                                            
   131          raise AliasAlreadyInUseFormError(private_key.alias)                                                                     
                                                                                                                                           
 ╭──────────────────────────────────── locals ────────────────────────────────────╮                                                        
  private_key = PrivateKeyAliased(                                                                                                       
                   value='5HtJR4ay36wdix2QVXQ738YhGYwKU4w6JickxMnmoHf9Av4tJTq',                                                         
                   file_path=None,                                                                                                      
                   alias='guest4test1@active'                                                                                           
                )                                                                                                                        
         self = NewAuthorityForm()                                                                                                       
 ╰────────────────────────────────────────────────────────────────────────────────╯                                                        
                                                                                                                                           
 /home/dev/1_workspace/clive/clive/__private/core/profile_data.py:83 in working_account                                                    
                                                                                                                                           
    80       NoWorkingAccountError: If no working account is set.                                                                        
    81       """
│    82 │   │   if not self.is_working_account_set():                                                                                       │
│ ❱  83 │   │   │   raise NoWorkingAccountError                                                                                             │
│    84 │   │   assert self._working_account is not None                                                                                    │
│    85 │   │   return self._working_account                                                                                                │
│    86                                                                                                                                     │
│                                                                                                                                           │
│ ╭──────────────────────────────────── locals ─────────────────────────────────────╮                                                       │
│ │ self = <clive.__private.core.profile_data.ProfileData object at 0x7fb4b4e034f0> │                                                       │
│ ╰─────────────────────────────────────────────────────────────────────────────────╯                                                       │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
NoWorkingAccountError

Merge request reports