Skip to content

Commit 48504b1

Browse files
committed
start accepting crates without authorship information
fix test fmt
1 parent 51ca554 commit 48504b1

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/controllers/krate/publish.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,6 @@ fn parse_new_headers(req: &mut dyn RequestExt) -> AppResult<EncodableCrateUpload
265265
if empty(new.license.as_ref()) && empty(new.license_file.as_ref()) {
266266
missing.push("license");
267267
}
268-
if new.authors.iter().all(String::is_empty) {
269-
missing.push("authors");
270-
}
271268
if !missing.is_empty() {
272269
let message = missing_metadata_error_message(&missing);
273270
return Err(cargo_err(&message));

src/tests/krate/publish.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ fn ignored_badges() {
818818
}
819819

820820
#[test]
821-
fn author_license_and_description_required() {
821+
fn license_and_description_required() {
822822
let (_, _, _, token) = TestApp::init().with_token();
823823

824824
let crate_to_publish = PublishBuilder::new("foo_metadata")
@@ -831,7 +831,7 @@ fn author_license_and_description_required() {
831831
assert_eq!(response.status(), StatusCode::OK);
832832
assert_eq!(
833833
response.json(),
834-
json!({ "errors": [{ "detail": missing_metadata_error_message(&["description", "license", "authors"]) }] })
834+
json!({ "errors": [{ "detail": missing_metadata_error_message(&["description", "license"]) }] })
835835
);
836836

837837
let crate_to_publish = PublishBuilder::new("foo_metadata")
@@ -844,7 +844,7 @@ fn author_license_and_description_required() {
844844
assert_eq!(response.status(), StatusCode::OK);
845845
assert_eq!(
846846
response.json(),
847-
json!({ "errors": [{ "detail": missing_metadata_error_message(&["description", "authors"]) }] })
847+
json!({ "errors": [{ "detail": missing_metadata_error_message(&["description"]) }] })
848848
);
849849

850850
let crate_to_publish = PublishBuilder::new("foo_metadata")

0 commit comments

Comments
 (0)