def create_model(self): user = self._user branch = self.target_combo.get_selected_data() if UserBranchAccess.has_access(self._store, user, branch): info( _(u'%s is already associated with %s.') % (user.person.name, branch.get_description())) return return UserBranchAccess(store=self._store, user=user, branch=branch)
def branch_with_access(store, client, example_creator): branch = example_creator.create_branch(cnpj='99.399.705/0001-90') UserBranchAccess(store=store, user=client.user, branch=branch) return branch