Fix marketplace offer creation provider NULL constraint violation
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Marketplace service: - Added default provider 'default-provider' when neither wallet nor provider provided - Fixes NOT NULL constraint violation on provider column - Allows offer creation without explicit provider/wallet specification
This commit is contained in:
@@ -114,6 +114,10 @@ class MarketplaceService:
|
||||
if 'wallet' in offer_data and 'provider' not in offer_data:
|
||||
offer_data['provider'] = offer_data['wallet']
|
||||
logger.info(f"Mapped wallet '{offer_data['wallet']}' to provider")
|
||||
# Set default provider if neither wallet nor provider provided
|
||||
if 'provider' not in offer_data or not offer_data['provider']:
|
||||
offer_data['provider'] = 'default-provider'
|
||||
logger.info("Set default provider: 'default-provider'")
|
||||
offer = MarketplaceOffer(**offer_data)
|
||||
self.session.add(offer)
|
||||
await self.session.commit()
|
||||
|
||||
Reference in New Issue
Block a user