Skip to content

Commit

Permalink
Merge pull request #642 from akvo/master
Browse files Browse the repository at this point in the history
[#612] merge 2.3.8 changes back into develop
  • Loading branch information
KasperBrandt committed Jun 19, 2014
2 parents 84a8ed4 + 8a96366 commit 0c6702f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions akvo/api/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.

from django.contrib.auth.models import User
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType

from tastypie.authentication import ApiKeyAuthentication
Expand Down Expand Up @@ -41,8 +41,8 @@ def is_authenticated(self, request, **kwargs):
return self._unauthorized()

try:
user = User.objects.get(username=username)
except (User.DoesNotExist, User.MultipleObjectsReturned):
user = get_user_model().objects.get(username=username)
except (get_user_model().DoesNotExist, get_user_model().MultipleObjectsReturned):
return self._unauthorized()

request.user = user
Expand Down
2 changes: 1 addition & 1 deletion akvo/api/resources/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class ProjectResource(ConditionalFullResource):

class Meta:
allowed_methods = ['get']
authentication = MultiAuthentication(ApiKeyAuthentication(), Authentication(),)
authentication = ConditionalApiKeyAuthentication(methods_requiring_key=['POST', 'PUT'])
queryset = Project.objects.all() #Note: this is modified in get_object_list()
resource_name = 'project'
include_absolute_url = True
Expand Down
4 changes: 2 additions & 2 deletions akvo/api/resources/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.


from django.contrib.auth.models import User
from django.contrib.auth import get_user_model

from tastypie.authentication import ApiKeyAuthentication
from tastypie.constants import ALL_WITH_RELATIONS, ALL
Expand All @@ -23,7 +23,7 @@ class UserResource(ConditionalFullResource):
class Meta:
authentication = ApiKeyAuthentication()
allowed_methods = ['get']
queryset = User.objects.filter(is_active=True)
queryset = get_user_model().objects.filter(is_active=True)
resource_name = 'user'
fields = ['username', 'first_name', 'last_name', 'last_login',]
filtering = dict(
Expand Down
2 changes: 1 addition & 1 deletion akvo/templates/partner_sites/project/project_main.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h2 class="marg_top40">{% trans "Share" %}</h2>
'facebook-share-dialog',
'width=626,height=436');
return false;">
<img src="{{STATIC_URL}}site/img/social/fb_share.jpg">
<img src="{{STATIC_URL}}rsr/main/img/social/fb_share.jpg">
</a>
</div>
<!--
Expand Down
2 changes: 1 addition & 1 deletion akvo/templates/partner_sites/project/update_main.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h2 class="marg_top40">{% trans "Share" %}</h2>
'facebook-share-dialog',
'width=626,height=436');
return false;">
<img src="{{MEDIA_URL}}akvo/img/social/fb_share.jpg">
<img src="{{STATIC_URL}}rsr/main/img/social/fb_share.jpg">
</a>
</div>
<!--
Expand Down
2 changes: 1 addition & 1 deletion scripts/deployment/pip/requirements/2_rsr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ mimeparse==0.1.3
python-dateutil==2.2
requests==2.3.0
djangorestframework==2.3.13
django-tastypie==0.11.1

# Django apps from VCS web services
-e git://github.com/akvo/django-counter.git@3b38f45a243970fda1a61124fd6ec8b9bd352c35#egg=django-counter
-e git://github.com/lukeman/django-sorting.git@d3456924ff2140c2a3466a2dd9d674486500393e#egg=django-sorting
-e git://github.com/akvo/djangoembed.git@3a1d6b955bcff4b2ec04eefca79a0b2ebb31289a#egg=djangoembed
-e git://github.com/akvo/django-tastypie.git@781fea26200b741c292cf166b30b7066e9e40f44#egg=django-tastypie
-e git://github.com/akvo/django-registration.git@d1ff9eba18854fc41892de5a16562db77b93a25a#egg=registration

# Akvonaut apps
Expand Down

0 comments on commit 0c6702f

Please sign in to comment.