Make location optional
Remove form validation and default value in input schema
This commit is contained in:
parent
c72661a87f
commit
b7d0e62844
@ -43,9 +43,7 @@ class AuthorityInputSchema(LemurInputSchema):
|
||||
organization = fields.String(
|
||||
missing=lambda: current_app.config.get("LEMUR_DEFAULT_ORGANIZATION")
|
||||
)
|
||||
location = fields.String(
|
||||
missing=lambda: current_app.config.get("LEMUR_DEFAULT_LOCATION")
|
||||
)
|
||||
location = fields.String()
|
||||
country = fields.String(
|
||||
missing=lambda: current_app.config.get("LEMUR_DEFAULT_COUNTRY")
|
||||
)
|
||||
|
@ -107,9 +107,7 @@ class CertificateInputSchema(CertificateCreationSchema):
|
||||
organization = fields.String(
|
||||
missing=lambda: current_app.config.get("LEMUR_DEFAULT_ORGANIZATION")
|
||||
)
|
||||
location = fields.String(
|
||||
missing=lambda: current_app.config.get("LEMUR_DEFAULT_LOCATION")
|
||||
)
|
||||
location = fields.String()
|
||||
country = fields.String(
|
||||
missing=lambda: current_app.config.get("LEMUR_DEFAULT_COUNTRY")
|
||||
)
|
||||
|
@ -26,8 +26,7 @@
|
||||
Location
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<input name="location" ng-model="authority.location" placeholder="Location" class="form-control" required/>
|
||||
<p ng-show="dnForm.location.$invalid && !dnForm.location.$pristine" class="help-block">You must enter a location</p>
|
||||
<input name="location" ng-model="authority.location" placeholder="Location" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group"
|
||||
|
@ -38,9 +38,7 @@
|
||||
Location
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<input name="location" ng-model="certificate.location" placeholder="Location" class="form-control" required/>
|
||||
<p ng-show="dnForm.location.$invalid && !dnForm.location.$pristine" class="help-block">You must enter a
|
||||
location</p>
|
||||
<input name="location" ng-model="certificate.location" placeholder="Location" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group"
|
||||
|
@ -154,7 +154,7 @@ def test_get_certificate_primitives(certificate):
|
||||
|
||||
with freeze_time(datetime.date(year=2016, month=10, day=30)):
|
||||
primitives = get_certificate_primitives(certificate)
|
||||
assert len(primitives) == 26
|
||||
assert len(primitives) == 25
|
||||
assert (primitives["key_type"] == "RSA2048")
|
||||
|
||||
|
||||
@ -254,17 +254,18 @@ def test_certificate_input_schema(client, authority):
|
||||
"validityStart": arrow.get(2018, 11, 9).isoformat(),
|
||||
"validityEnd": arrow.get(2019, 11, 9).isoformat(),
|
||||
"dnsProvider": None,
|
||||
"location": "A Place"
|
||||
}
|
||||
|
||||
data, errors = CertificateInputSchema().load(input_data)
|
||||
|
||||
assert not errors
|
||||
assert data["authority"].id == authority.id
|
||||
assert data["location"] == "A Place"
|
||||
|
||||
# make sure the defaults got set
|
||||
assert data["common_name"] == "test.example.com"
|
||||
assert data["country"] == "US"
|
||||
assert data["location"] == "Los Gatos"
|
||||
|
||||
assert len(data.keys()) == 19
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user