- Minor input validation fix, nothing to see here.

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4042271
This commit is contained in:
suhacan
2009-11-26 01:03:48 +00:00
parent 72d8a24ec4
commit cc57dae5ca
3 changed files with 13 additions and 4 deletions

View File

@@ -63,8 +63,11 @@ namespace Orchard.Tags.Controllers {
else {
if (!_authorizer.Authorize(Permissions.CreateTag, T("Couldn't create tag")))
return new HttpUnauthorizedResult();
_tagService.CreateTag(newTagName);
_tagService.TagContentItem(taggedContentId, newTagName);
if (!String.IsNullOrEmpty(newTagName)) {
_tagService.CreateTag(newTagName);
_tagService.TagContentItem(taggedContentId, newTagName);
}
}
if (!String.IsNullOrEmpty(returnUrl)) {
return Redirect(returnUrl);

View File

@@ -1,7 +1,10 @@
using Orchard.Mvc.ViewModels;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using Orchard.Mvc.ViewModels;
namespace Orchard.Tags.ViewModels {
public class TagsAdminCreateViewModel : AdminViewModel {
[Required, DisplayName("Name:")]
public string TagName { get; set; }
}
}

View File

@@ -1,8 +1,11 @@
using Orchard.Mvc.ViewModels;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using Orchard.Mvc.ViewModels;
namespace Orchard.Tags.ViewModels {
public class TagsAdminEditViewModel : AdminViewModel {
public int Id { get; set; }
[Required, DisplayName("Name:")]
public string TagName { get; set; }
}
}