Show More
@@ -36,7 +36,6 b' def admin_auth(username, password):' | |||||
36 | def authfunc(environ, username, password): |
|
36 | def authfunc(environ, username, password): | |
37 | sa = meta.Session |
|
37 | sa = meta.Session | |
38 | password_crypt = get_crypt_password(password) |
|
38 | password_crypt = get_crypt_password(password) | |
39 |
|
||||
40 | try: |
|
39 | try: | |
41 | user = sa.query(Users).filter(Users.username == username).one() |
|
40 | user = sa.query(Users).filter(Users.username == username).one() | |
42 | except (NoResultFound, MultipleResultsFound, OperationalError) as e: |
|
41 | except (NoResultFound, MultipleResultsFound, OperationalError) as e: |
@@ -1,8 +1,16 b'' | |||||
1 |
|
1 | |||
2 | def get_repo_slug(request): |
|
2 | def get_repo_slug(request): | |
3 | path_info = request.environ.get('PATH_INFO') |
|
3 | path_info = request.environ.get('PATH_INFO') | |
4 | uri_lst = path_info.split('/') |
|
4 | uri_lst = path_info.split('/') | |
5 | print uri_lst |
|
|||
6 | print 'len', len(uri_lst) |
|
|||
7 | repo_name = uri_lst[1] |
|
5 | repo_name = uri_lst[1] | |
8 | return repo_name |
|
6 | return repo_name | |
|
7 | ||||
|
8 | def is_mercurial(environ): | |||
|
9 | """ | |||
|
10 | Returns True if request's target is mercurial server - header | |||
|
11 | ``HTTP_ACCEPT`` of such request would start with ``application/mercurial``. | |||
|
12 | """ | |||
|
13 | http_accept = environ.get('HTTP_ACCEPT') | |||
|
14 | if http_accept and http_accept.startswith('application/mercurial'): | |||
|
15 | return True | |||
|
16 | return False |
General Comments 0
You need to be logged in to leave comments.
Login now