mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-12-19 00:09:21 +11:00
Shorter random URLs and no longer a trailing slash.
This commit is contained in:
parent
4c96e1eb17
commit
4ba94ce64e
2 changed files with 2 additions and 2 deletions
|
@ -7,7 +7,7 @@ from django.utils.translation import ugettext_lazy as _
|
|||
from dpaste.highlight import LEXER_DEFAULT
|
||||
|
||||
t = 'abcdefghijkmnopqrstuvwwxyzABCDEFGHIJKLOMNOPQRSTUVWXYZ1234567890'
|
||||
def generate_secret_id(length=5):
|
||||
def generate_secret_id(length=4):
|
||||
return ''.join([random.choice(t) for i in range(length)])
|
||||
|
||||
class Snippet(models.Model):
|
||||
|
|
|
@ -4,7 +4,7 @@ urlpatterns = patterns('dpaste.views',
|
|||
url(r'^$', 'snippet_new', name='snippet_new'),
|
||||
url(r'^diff/$', 'snippet_diff', name='snippet_diff'),
|
||||
url(r'^history/$', 'snippet_history', name='snippet_history'),
|
||||
url(r'^(?P<snippet_id>[a-zA-Z0-9]+)/$', 'snippet_details', name='snippet_details'),
|
||||
url(r'^(?P<snippet_id>[a-zA-Z0-9]+)/?$', 'snippet_details', name='snippet_details'),
|
||||
url(r'^(?P<snippet_id>[a-zA-Z0-9]+)/delete/$', 'snippet_delete', name='snippet_delete'),
|
||||
url(r'^(?P<snippet_id>[a-zA-Z0-9]+)/gist/$', 'snippet_gist', name='snippet_gist'),
|
||||
url(r'^(?P<snippet_id>[a-zA-Z0-9]+)/raw/$', 'snippet_details', {'template_name': 'dpaste/snippet_details_raw.html', 'is_raw': True}, name='snippet_details_raw'),
|
||||
|
|
Loading…
Reference in a new issue