Disallow titles > 255 chars.
parent
945f4e153d
commit
c4bf1562db
|
@ -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 "
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
</div>
|
||||
<h2> </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">
|
||||
|
|
Loading…
Reference in New Issue