mirror of
https://github.com/Tygs/0bin.git
synced 2023-08-10 21:13:00 +03:00
merge
This commit is contained in:
parent
36216fe118
commit
c770457883
@ -29,4 +29,4 @@ GROUP = None
|
|||||||
|
|
||||||
# limit size of pasted text in bytes. Be carefull allowing too much size can slow down user's
|
# limit size of pasted text in bytes. Be carefull allowing too much size can slow down user's
|
||||||
# browser
|
# browser
|
||||||
MAX_SIZE = 500 * 1000
|
MAX_SIZE = 1024 * 50
|
||||||
|
@ -154,14 +154,12 @@ class Paste(object):
|
|||||||
self.expiration = self.expiration + '#%s' % datetime.now()
|
self.expiration = self.expiration + '#%s' % datetime.now()
|
||||||
|
|
||||||
# write the paste
|
# write the paste
|
||||||
try:
|
|
||||||
with open(self.path, 'w') as f:
|
with open(self.path, 'w') as f:
|
||||||
f.write(unicode(self.expiration) + '\n')
|
f.write(unicode(self.expiration) + '\n')
|
||||||
f.write(self.content + '\n')
|
f.write(self.content + '\n')
|
||||||
if self.comments:
|
if self.comments:
|
||||||
f.write(comments)
|
f.write(comments)
|
||||||
except Exception as e:
|
|
||||||
import ipdb; ipdb.set_trace()
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
||||||
|
4
start.py
4
start.py
@ -54,6 +54,10 @@ def create_paste():
|
|||||||
return ''
|
return ''
|
||||||
|
|
||||||
if content:
|
if content:
|
||||||
|
# check size of the paste. if more than settings return error without saving paste.
|
||||||
|
# prevent from unusual use of the system.
|
||||||
|
# need to be improved
|
||||||
|
if len(content) < settings.MAX_SIZE:
|
||||||
expiration = request.forms.get('expiration', u'burn_after_reading')
|
expiration = request.forms.get('expiration', u'burn_after_reading')
|
||||||
paste = Paste(expiration=expiration, content=content)
|
paste = Paste(expiration=expiration, content=content)
|
||||||
paste.save()
|
paste.save()
|
||||||
|
@ -259,6 +259,10 @@ button.btn, input[type="submit"].btn {
|
|||||||
top:-4px;
|
top:-4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#alert-template {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
/** Progress bar */
|
/** Progress bar */
|
||||||
|
|
||||||
.progress {
|
.progress {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user