Commit 7f9d24e862b7daaa9f2725d82f527bbb9b99f12e

Authored by Sergio Oliveira
2 parents cdff31d7 cb04d56e

Merge branch 'master' of github.com:TracyWebTech/colab

src/accounts/search_indexes.py
@@ -32,7 +32,6 @@ class UserIndex(indexes.SearchIndex, indexes.Indexable): @@ -32,7 +32,6 @@ class UserIndex(indexes.SearchIndex, indexes.Indexable):
32 def prepare_description(self, obj): 32 def prepare_description(self, obj):
33 return u'{}\n{}\n{}\n{}\n{}\n{}'.format( 33 return u'{}\n{}\n{}\n{}\n{}\n{}'.format(
34 obj.institution, obj.role, obj.username, obj.get_full_name(), 34 obj.institution, obj.role, obj.username, obj.get_full_name(),
35 - obj.google_talk, obj.webpage  
36 ) 35 )
37 36
38 def prepare_icon_name(self, obj): 37 def prepare_icon_name(self, obj):
src/proxy/models.py
@@ -73,7 +73,7 @@ class Wiki(models.Model): @@ -73,7 +73,7 @@ class Wiki(models.Model):
73 db_table = 'wiki_view' 73 db_table = 'wiki_view'
74 74
75 def get_absolute_url(self): 75 def get_absolute_url(self):
76 - return u'/ticket/{}'.format(self.name) 76 + return u'/wiki/{}'.format(self.name)
77 77
78 def get_author(self): 78 def get_author(self):
79 try: 79 try:
src/super_archives/utils/url.py
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 2
3 -def append_to_get(path, query=None, **kwargs):  
4 -# Getting the path with the query  
5 - current_url = u'{}?{}'.format(  
6 - path,  
7 - query,  
8 - ) 3 +import urllib
  4 +import urlparse
9 5
10 - if kwargs and query:  
11 - current_url += '&'  
12 6
  7 +def append_to_get(path, query=None, **kwargs):
  8 + query_dict = dict(urlparse.parse_qsl(query))
13 for key, value in kwargs.items(): 9 for key, value in kwargs.items():
14 - # get the key, value to check if the pair exists in the query  
15 - new = u'{}={}'.format(key, value)  
16 -  
17 - if new in current_url:  
18 - continue  
19 -  
20 - if key not in current_url:  
21 - current_url += u'{}={}&'.format(key, value)  
22 - continue  
23 -  
24 - parse_url = current_url.split(key)  
25 -  
26 - if len(parse_url) > 2:  
27 - continue  
28 -  
29 - if unicode(value) in parse_url[1][1:]:  
30 - continue  
31 -  
32 - check_kwargs_values = [  
33 - False for value in kwargs.values()  
34 - if unicode(value) not in parse_url[1]  
35 - ]  
36 -  
37 - if not all(check_kwargs_values):  
38 - list_remaining = parse_url[1][1:].split('&')  
39 - real_remaining = u''  
40 -  
41 - if len(list_remaining) >= 2:  
42 - real_remaining = u'&'.join(list_remaining[1:])  
43 -  
44 - current_url = u'{url}{key}={value}&{remaining}'.format(  
45 - url=parse_url[0],  
46 - key=key,  
47 - value=value,  
48 - remaining=real_remaining,  
49 - )  
50 - continue  
51 -  
52 - current_url = u'{url}{key}={value}+{remaining_get}'.format(  
53 - url=parse_url[0],  
54 - key=key,  
55 - value=value,  
56 - remaining_get=parse_url[1][1:],  
57 - )  
58 - if current_url[-1] == '&':  
59 - return current_url[:-1]  
60 - return current_url 10 + query_dict[key] = value
  11 + return u'{}?{}'.format(path, urllib.urlencode(query_dict))
61 12
62 13
63 def pop_from_get(path, query=None, **kwargs): 14 def pop_from_get(path, query=None, **kwargs):
src/templates/search/search.html
@@ -70,7 +70,7 @@ @@ -70,7 +70,7 @@
70 {% endfor %} 70 {% endfor %}
71 </ul> 71 </ul>
72 72
73 - {% if query and page.has_other_pages %} 73 + {% if page.has_other_pages %}
74 <div class="text-center"> 74 <div class="text-center">
75 <span> 75 <span>
76 {% if page.has_previous %} 76 {% if page.has_previous %}