mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-11-15 08:02:54 +11:00
minor fixes (#114)
This commit is contained in:
parent
3bfb153b74
commit
f06761c1ff
3 changed files with 3 additions and 4 deletions
|
@ -66,7 +66,7 @@ class SnippetForm(forms.ModelForm):
|
||||||
|
|
||||||
def clean_content(self):
|
def clean_content(self):
|
||||||
content = self.cleaned_data.get('content', '')
|
content = self.cleaned_data.get('content', '')
|
||||||
if content.strip() == '':
|
if not content.strip():
|
||||||
raise forms.ValidationError(_('This field is required.'))
|
raise forms.ValidationError(_('This field is required.'))
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|
|
@ -114,8 +114,7 @@ class NakedHtmlFormatter(HtmlFormatter):
|
||||||
return self._wrap_code(source)
|
return self._wrap_code(source)
|
||||||
|
|
||||||
def _wrap_code(self, source):
|
def _wrap_code(self, source):
|
||||||
for i, t in source:
|
yield from source
|
||||||
yield i, t
|
|
||||||
|
|
||||||
|
|
||||||
class PlainCodeHighlighter(Highlighter):
|
class PlainCodeHighlighter(Highlighter):
|
||||||
|
|
|
@ -257,7 +257,7 @@ class APIView(View):
|
||||||
lexer = config.PLAIN_CODE_SYMBOL
|
lexer = config.PLAIN_CODE_SYMBOL
|
||||||
|
|
||||||
if expires:
|
if expires:
|
||||||
expire_options = [str(i) for i in dict(config.EXPIRE_CHOICES).keys()]
|
expire_options = [str(i) for i in dict(config.EXPIRE_CHOICES)]
|
||||||
if expires not in expire_options:
|
if expires not in expire_options:
|
||||||
return HttpResponseBadRequest(
|
return HttpResponseBadRequest(
|
||||||
'Invalid expire choice "{}" given. Valid values are: {}'.format(
|
'Invalid expire choice "{}" given. Valid values are: {}'.format(
|
||||||
|
|
Loading…
Reference in a new issue