File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,12 @@ use crate::render;
1616use crate :: util:: { read_fill, read_le_u32, Maximums } ;
1717use crate :: views:: { EncodableCrateUpload , GoodCrate , PublishWarnings } ;
1818
19+ pub const MISSING_RIGHTS_ERROR_MESSAGE : & str =
20+ "this crate exists but you don't seem to be an owner. \
21+ If you believe this is a mistake, perhaps you need \
22+ to accept an invitation to be an owner before \
23+ publishing.";
24+
1925/// Handles the `PUT /crates/new` route.
2026/// Used by `cargo publish` to publish a new crate or to publish a new version of an
2127/// existing crate.
@@ -98,12 +104,7 @@ pub fn publish(req: &mut dyn RequestExt) -> EndpointResult {
98104
99105 let owners = krate. owners ( & conn) ?;
100106 if user. rights ( req. app ( ) , & owners) ? < Rights :: Publish {
101- return Err ( cargo_err (
102- "this crate exists but you don't seem to be an owner. \
103- If you believe this is a mistake, perhaps you need \
104- to accept an invitation to be an owner before \
105- publishing.",
106- ) ) ;
107+ return Err ( cargo_err ( MISSING_RIGHTS_ERROR_MESSAGE ) ) ;
107108 }
108109
109110 if krate. name != * name {
You can’t perform that action at this time.
0 commit comments