From b0bd0435c4d63e0b63c105959627294780aba7bf Mon Sep 17 00:00:00 2001 From: Curtis Castrapel Date: Tue, 10 Apr 2018 16:04:07 -0700 Subject: [PATCH] more stuff --- lemur/dns_providers/models.py | 22 ++++++++++--------- lemur/dns_providers/service.py | 8 +------ lemur/models.py | 13 ----------- .../certificates/certificate/options.tpl.html | 20 +++++++---------- 4 files changed, 21 insertions(+), 42 deletions(-) diff --git a/lemur/dns_providers/models.py b/lemur/dns_providers/models.py index f43aac0b..809c5247 100644 --- a/lemur/dns_providers/models.py +++ b/lemur/dns_providers/models.py @@ -6,13 +6,15 @@ from lemur.database import db class DnsProviders(db.Model): - __tablename__ = 'dns_providers' - id = Column(Integer(), primary_key=True) - name = Column(String(length=256), unique=True, nullable=True) - description = Column(String(length=1024), nullable=True) - provider_type = Column(String(length=256), nullable=True) - credentials = Column(String(length=256), nullable=True) - api_endpoint = Column(String(length=256), nullable=True) - date_created = Column(ArrowType(), server_default=text('now()'), nullable=False) - status = Column(String(length=128), nullable=True) - options = Column(JSON) + db.Table('dns_providers', + Column('id', Integer(), nullable=False), + Column('name', String(length=256), nullable=True), + Column('description', String(length=1024), nullable=True), + Column('provider_type', String(length=256), nullable=True), + Column('credentials', String(length=256), nullable=True), + Column('api_endpoint', String(length=256), nullable=True), + Column('date_created', ArrowType(), server_default=text('now()'), nullable=False), + Column('status', String(length=128), nullable=True), + Column('options', JSON), + PrimaryKeyConstraint('id'), + UniqueConstraint('name')) \ No newline at end of file diff --git a/lemur/dns_providers/service.py b/lemur/dns_providers/service.py index fa752d09..3a376040 100644 --- a/lemur/dns_providers/service.py +++ b/lemur/dns_providers/service.py @@ -7,10 +7,4 @@ def get_all_dns_providers(status="active"): :return: """ - all_dns_providers = DnsProviders.query.all() - dns_provider_result = [] - for provider in all_dns_providers: - print(provider) - if provider.status == status: - dns_provider_result.append(provider.__dict__) - return dns_provider_result + return DnsProviders.query.all(status=status) \ No newline at end of file diff --git a/lemur/models.py b/lemur/models.py index 3a9cf121..9f352bb9 100644 --- a/lemur/models.py +++ b/lemur/models.py @@ -132,16 +132,3 @@ pending_cert_role_associations = db.Table('pending_cert_role_associations', ) Index('pending_cert_role_associations_ix', pending_cert_role_associations.c.pending_cert_id, pending_cert_role_associations.c.role_id) - -dns_providers = db.Table('dns_providers', - Column('id', Integer(), nullable=False), - Column('name', String(length=256), nullable=True), - Column('description', String(length=1024), nullable=True), - Column('provider_type', String(length=256), nullable=True), - Column('credentials', String(length=256), nullable=True), - Column('api_endpoint', String(length=256), nullable=True), - Column('date_created', ArrowType(), server_default=text('now()'), nullable=False), - Column('status', String(length=128), nullable=True), - Column('options', JSON), - PrimaryKeyConstraint('id'), - UniqueConstraint('name')) diff --git a/lemur/static/app/angular/certificates/certificate/options.tpl.html b/lemur/static/app/angular/certificates/certificate/options.tpl.html index 14fc3de8..a498a6c8 100644 --- a/lemur/static/app/angular/certificates/certificate/options.tpl.html +++ b/lemur/static/app/angular/certificates/certificate/options.tpl.html @@ -234,18 +234,14 @@ -
- -
- -
- -
-
- -
+