Fixing up a couple of pull request comments

- python style if
- renamed the relationships
This commit is contained in:
Martyn Inglis
2016-05-11 15:36:17 +01:00
parent 668f311a1a
commit b22c52131d
2 changed files with 3 additions and 3 deletions

View File

@@ -467,7 +467,7 @@ def provider_to_use(notification_type, notification_id):
provider for provider in get_provider_details_by_notification_type(notification_type) if provider.active
]
if len(active_providers_in_order) == 0:
if not active_providers_in_order:
current_app.logger.error(
"{} {} failed as no active providers".format(notification_type, notification_id)
)

View File

@@ -200,7 +200,7 @@ class ProviderStatistics(db.Model):
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
day = db.Column(db.Date, nullable=False)
provider_id = db.Column(UUID(as_uuid=True), db.ForeignKey('provider_details.id'), index=True, nullable=False)
provider_stats_to_provider = db.relationship(
provider = db.relationship(
'ProviderDetails', backref=db.backref('provider_stats', lazy='dynamic')
)
service_id = db.Column(UUID(as_uuid=True), db.ForeignKey('services.id'), index=True, nullable=False)
@@ -215,7 +215,7 @@ class ProviderRates(db.Model):
valid_from = db.Column(db.DateTime, nullable=False)
rate = db.Column(db.Numeric(), nullable=False)
provider_id = db.Column(UUID(as_uuid=True), db.ForeignKey('provider_details.id'), index=True, nullable=False)
provider_rate_to_provider = db.relationship('ProviderDetails', backref=db.backref('provider_rates', lazy='dynamic'))
provider = db.relationship('ProviderDetails', backref=db.backref('provider_rates', lazy='dynamic'))
class ProviderDetails(db.Model):