Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #1641 - Accept License flag was getting cleared by an automatic edit #1690

Merged
merged 1 commit into from
Nov 4, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions src/NuGetGallery/Controllers/PackagesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -749,27 +749,28 @@ public virtual async Task<ActionResult> VerifyPackage()
}
}

return View(
new VerifyPackageRequest
var model = new VerifyPackageRequest
{
Id = packageMetadata.Id,
Version = packageMetadata.Version.ToNormalizedStringSafe(),
LicenseUrl = packageMetadata.LicenseUrl.ToEncodedUrlStringOrNull(),
Listed = true,
Edit = new EditPackageVersionRequest
{
Id = packageMetadata.Id,
Version = packageMetadata.Version.ToNormalizedStringSafe(),
Authors = packageMetadata.Authors.Flatten(),
Copyright = packageMetadata.Copyright,
Description = packageMetadata.Description,
IconUrl = packageMetadata.IconUrl.ToEncodedUrlStringOrNull(),
LicenseUrl = packageMetadata.LicenseUrl.ToEncodedUrlStringOrNull(),
Listed = true,
Edit = new EditPackageVersionRequest
{
Authors = packageMetadata.Authors.Flatten(),
Copyright = packageMetadata.Copyright,
Description = packageMetadata.Description,
IconUrl = packageMetadata.IconUrl.ToEncodedUrlStringOrNull(),
ProjectUrl = packageMetadata.ProjectUrl.ToEncodedUrlStringOrNull(),
ReleaseNotes = packageMetadata.ReleaseNotes,
RequiresLicenseAcceptance = packageMetadata.RequireLicenseAcceptance,
Summary = packageMetadata.Summary,
Tags = PackageHelper.ParseTags(packageMetadata.Tags),
VersionTitle = packageMetadata.Title,
}
});
ProjectUrl = packageMetadata.ProjectUrl.ToEncodedUrlStringOrNull(),
ReleaseNotes = packageMetadata.ReleaseNotes,
RequiresLicenseAcceptance = packageMetadata.RequireLicenseAcceptance,
Summary = packageMetadata.Summary,
Tags = PackageHelper.ParseTags(packageMetadata.Tags),
VersionTitle = packageMetadata.Title,
}
};
return View(model);
}

[Authorize]
Expand Down
2 changes: 1 addition & 1 deletion src/NuGetGallery/Views/Packages/VerifyPackage.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<li>@EditableField("Tags", m => m.Edit.Tags)</li>
<li>@EditableField("Release Notes", m => m.Edit.ReleaseNotes, pre: true)</li>

@if (!String.IsNullOrEmpty(Model.Edit.LicenseUrl))
@if (!String.IsNullOrEmpty(Model.LicenseUrl))
{
<li>
<h4>Requires License Acceptance
Expand Down