-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from labhackercd/develop
Edemocracia integration
- Loading branch information
Showing
10 changed files
with
126 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from tastypie.authorization import Authorization | ||
from tastypie.exceptions import Unauthorized | ||
from django.conf import settings | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
|
||
class UpdateUserAuthorization(Authorization): | ||
|
||
def api_key_is_valid(self, bundle): | ||
api_key = bundle.request.GET.get('api_key', None) | ||
if api_key and api_key == settings.API_KEY: | ||
return True | ||
else: | ||
raise Unauthorized(_('Missing api key')) | ||
|
||
def update_list(self, object_list, bundle): | ||
raise Unauthorized(_('You cannot perform this action')) | ||
|
||
def update_detail(self, object_list, bundle): | ||
return self.api_key_is_valid(bundle) | ||
|
||
def delete_list(self, object_list, bundle): | ||
raise Unauthorized(_('You cannot perform this action')) | ||
|
||
def delete_detail(self, object_list, bundle): | ||
return self.api_key_is_valid(bundle) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2017-06-07 13:18-0300\n" | ||
"POT-Creation-Date: 2018-01-24 11:17-0200\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -66,6 +66,14 @@ msgstr "" | |
msgid "Users" | ||
msgstr "" | ||
|
||
#: api/authorization.py:14 | ||
msgid "Missing api key" | ||
msgstr "" | ||
|
||
#: api/authorization.py:17 api/authorization.py:23 | ||
msgid "You cannot perform this action" | ||
msgstr "" | ||
|
||
#: core/admin.py:23 core/models.py:160 | ||
msgid "reference" | ||
msgstr "" | ||
|
@@ -368,8 +376,8 @@ msgid "New" | |
msgstr "" | ||
|
||
#: core/templates/base.html:34 core/templates/base.html:36 | ||
#: core/templates/base.html:38 core/views.py:213 core/views.py:233 | ||
#: core/views.py:255 core/views.py:298 | ||
#: core/templates/base.html:38 core/views.py:214 core/views.py:234 | ||
#: core/views.py:256 core/views.py:299 | ||
msgid "Oops" | ||
msgstr "" | ||
|
||
|
@@ -569,33 +577,33 @@ msgstr "" | |
msgid "Access control. Please log in and try again." | ||
msgstr "" | ||
|
||
#: core/views.py:74 | ||
#: core/views.py:75 | ||
msgid "Access denied. Please contact the project author." | ||
msgstr "" | ||
|
||
#: core/views.py:97 core/views.py:116 | ||
#: core/views.py:98 core/views.py:117 | ||
msgid "" | ||
"The following URL has returned no known bill: <br> <strong>{}/bill/{}</" | ||
"strong>" | ||
msgstr "" | ||
|
||
#: core/views.py:135 | ||
#: core/views.py:136 | ||
msgid "The following URL has returned no known segment." | ||
msgstr "" | ||
|
||
#: core/views.py:214 | ||
#: core/views.py:215 | ||
msgid "This bill is closed for participation :(" | ||
msgstr "" | ||
|
||
#: core/views.py:234 | ||
#: core/views.py:235 | ||
msgid "You must be logged to comment :(" | ||
msgstr "" | ||
|
||
#: core/views.py:256 | ||
#: core/views.py:257 | ||
msgid "You must be logged to vote :(" | ||
msgstr "" | ||
|
||
#: core/views.py:299 | ||
#: core/views.py:300 | ||
msgid "You must be logged to suggest new amendment :(" | ||
msgstr "" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2017-06-07 13:18-0300\n" | ||
"POT-Creation-Date: 2018-01-24 11:17-0200\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -67,6 +67,14 @@ msgstr "" | |
msgid "Users" | ||
msgstr "" | ||
|
||
#: api/authorization.py:14 | ||
msgid "Missing api key" | ||
msgstr "" | ||
|
||
#: api/authorization.py:17 api/authorization.py:23 | ||
msgid "You cannot perform this action" | ||
msgstr "" | ||
|
||
#: core/admin.py:23 core/models.py:160 | ||
msgid "reference" | ||
msgstr "" | ||
|
@@ -369,8 +377,8 @@ msgid "New" | |
msgstr "" | ||
|
||
#: core/templates/base.html:34 core/templates/base.html:36 | ||
#: core/templates/base.html:38 core/views.py:213 core/views.py:233 | ||
#: core/views.py:255 core/views.py:298 | ||
#: core/templates/base.html:38 core/views.py:214 core/views.py:234 | ||
#: core/views.py:256 core/views.py:299 | ||
msgid "Oops" | ||
msgstr "" | ||
|
||
|
@@ -570,33 +578,33 @@ msgstr "" | |
msgid "Access control. Please log in and try again." | ||
msgstr "" | ||
|
||
#: core/views.py:74 | ||
#: core/views.py:75 | ||
msgid "Access denied. Please contact the project author." | ||
msgstr "" | ||
|
||
#: core/views.py:97 core/views.py:116 | ||
#: core/views.py:98 core/views.py:117 | ||
msgid "" | ||
"The following URL has returned no known bill: <br> <strong>{}/bill/{}</" | ||
"strong>" | ||
msgstr "" | ||
|
||
#: core/views.py:135 | ||
#: core/views.py:136 | ||
msgid "The following URL has returned no known segment." | ||
msgstr "" | ||
|
||
#: core/views.py:214 | ||
#: core/views.py:215 | ||
msgid "This bill is closed for participation :(" | ||
msgstr "" | ||
|
||
#: core/views.py:234 | ||
#: core/views.py:235 | ||
msgid "You must be logged to comment :(" | ||
msgstr "" | ||
|
||
#: core/views.py:256 | ||
#: core/views.py:257 | ||
msgid "You must be logged to vote :(" | ||
msgstr "" | ||
|
||
#: core/views.py:299 | ||
#: core/views.py:300 | ||
msgid "You must be logged to suggest new amendment :(" | ||
msgstr "" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ msgid "" | |
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2017-06-07 13:18-0300\n" | ||
"POT-Creation-Date: 2018-01-24 11:17-0200\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
|
@@ -68,6 +68,14 @@ msgstr "Usuário" | |
msgid "Users" | ||
msgstr "Usuários" | ||
|
||
#: api/authorization.py:14 | ||
msgid "Missing api key" | ||
msgstr "Chave da api não encontrada" | ||
|
||
#: api/authorization.py:17 api/authorization.py:23 | ||
msgid "You cannot perform this action" | ||
msgstr "Você não pode realizar essa ação" | ||
|
||
#: core/admin.py:23 core/models.py:160 | ||
msgid "reference" | ||
msgstr "referência" | ||
|
@@ -370,8 +378,8 @@ msgid "New" | |
msgstr "Novo" | ||
|
||
#: core/templates/base.html:34 core/templates/base.html:36 | ||
#: core/templates/base.html:38 core/views.py:213 core/views.py:233 | ||
#: core/views.py:255 core/views.py:298 | ||
#: core/templates/base.html:38 core/views.py:214 core/views.py:234 | ||
#: core/views.py:256 core/views.py:299 | ||
msgid "Oops" | ||
msgstr "Oops" | ||
|
||
|
@@ -577,35 +585,35 @@ msgstr "Erro 403" | |
msgid "Access control. Please log in and try again." | ||
msgstr "Acesso controlado. Faça o login e tente novamente." | ||
|
||
#: core/views.py:74 | ||
#: core/views.py:75 | ||
msgid "Access denied. Please contact the project author." | ||
msgstr "Acesso negado. Favor contatar o autor do projeto." | ||
|
||
#: core/views.py:97 core/views.py:116 | ||
#: core/views.py:98 core/views.py:117 | ||
msgid "" | ||
"The following URL has returned no known bill: <br> <strong>{}/bill/{}</" | ||
"strong>" | ||
msgstr "" | ||
"A seguinte URL não retornou um projeto de lei conhecido: <br> <strong>{}/" | ||
"bill/{}</strong>" | ||
|
||
#: core/views.py:135 | ||
#: core/views.py:136 | ||
msgid "The following URL has returned no known segment." | ||
msgstr "A seguinte URL não retornou um trecho conhecido." | ||
|
||
#: core/views.py:214 | ||
#: core/views.py:215 | ||
msgid "This bill is closed for participation :(" | ||
msgstr "Este projeto de lei está fechado para participação :(" | ||
|
||
#: core/views.py:234 | ||
#: core/views.py:235 | ||
msgid "You must be logged to comment :(" | ||
msgstr "Você deve estar logado para comentar :(" | ||
|
||
#: core/views.py:256 | ||
#: core/views.py:257 | ||
msgid "You must be logged to vote :(" | ||
msgstr "Você deve estar logado para votar :(" | ||
|
||
#: core/views.py:299 | ||
#: core/views.py:300 | ||
msgid "You must be logged to suggest new amendment :(" | ||
msgstr "Você deve estar logado para sugerir uma nova proposta :(" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.