Disallow titles > 255 chars.

master
Nick Sergeant 2015-11-04 20:53:13 -05:00
parent 945f4e153d
commit c4bf1562db
2 changed files with 4 additions and 1 deletions

View File

@ -150,6 +150,9 @@ class SniptValidation(Validation):
def is_valid(self, bundle, request=None):
errors = {}
if (len(bundle.data['title']) > 255):
errors['title-length'] = ("Title must be 255 characters or less.")
if request.user.profile.has_pro is False:
if ('public' not in bundle.data or bundle.data['public'] is False):
errors['not-pro'] = ("You'll need to go Pro "

View File

@ -25,7 +25,7 @@
</div>
<h2>&nbsp;</h2>
<h1>
<input type="text" id="snipt_title" placeholder="Title" value="<% if (snipt.title != 'Untitled') { %><%= snipt.title %><% } %>" />
<input maxlength="255" type="text" id="snipt_title" placeholder="Title" value="<% if (snipt.title != 'Untitled') { %><%= snipt.title %><% } %>" />
</h1>
</header>
<section class="code">