CapPaste: Also check the title in can_post
Because unsurprisingly pastealacon has silly restrictions.
This commit is contained in:
parent
0d2148bd84
commit
dd6864c2c4
4 changed files with 18 additions and 10 deletions
|
|
@ -63,10 +63,12 @@ class PastebinBackend(BaseBackend, BasePasteBackend):
|
|||
def new_paste(self, *args, **kwargs):
|
||||
return PastebinPaste(*args, **kwargs)
|
||||
|
||||
def can_post(self, contents, public=None, max_age=None):
|
||||
def can_post(self, contents, title=None, public=None, max_age=None):
|
||||
if max_age is not None:
|
||||
if self.get_closest_expiration(max_age) is None:
|
||||
return 0
|
||||
if not title or len(title) <= 60:
|
||||
return 2
|
||||
return 1
|
||||
|
||||
def get_paste(self, _id):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue