Skip to content

Commit

Permalink
Merge fa93c40 into 358d168
Browse files Browse the repository at this point in the history
  • Loading branch information
aviveiros11 committed Aug 12, 2020
2 parents 358d168 + fa93c40 commit 242952e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Using Python, use the requests library::

import requests

result = requests.get('https://seed-platform.org/api/v2/version/', auth=(user_email, api_key))
result = requests.get('https://seed-platform.org/api/version/', auth=(user_email, api_key))
print result.json()

Using curl, pass the username and API key as follows::

curl -u user_email:api_key http://seed-platform.org/api/v2/version/
curl -u user_email:api_key http://seed-platform.org/api/version/

If authentication fails, the response's status code will be 302, redirecting the user to ``/app/login``.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ angular.module('BE.seed.controller.export_inventory_modal', []).controller('expo
var ext = '.' + export_type;
if (!_.endsWith(filename, ext)) filename += ext;

return $http.post('/api/v2.1/tax_lot_properties/export/', {
return $http.post('/api/v3/tax_lot_properties/export/', {
ids: ids,
filename: filename,
profile_id: profile_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ angular.module('BE.seed.controller.inventory_detail', [])
// profileId = $scope.currentProfile.id;
// }

$http.post('/api/v2.1/tax_lot_properties/export/', {
$http.post('/api/v3/tax_lot_properties/export/', {
ids: [$stateParams.view_id],
filename: filename,
profile_id: null, // TODO: reconfigure backend to handle detail settings profiles
Expand Down
2 changes: 1 addition & 1 deletion seed/static/seed/js/services/main_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ angular.module('BE.seed.service.main', []).factory('main_service', [
var main_factory = {};

main_factory.version = function () {
return $http.get('/api/v2/version/').then(function (response) {
return $http.get('/api/version/').then(function (response) {
return response.data;
});
};
Expand Down
2 changes: 1 addition & 1 deletion seed/static/seed/partials/developer.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h2><i class="fa fa-code" style="font-weight: bold;"></i> {$:: 'API Key' | trans
<div ng-if="user.api_key" style="margin-top: 30px;">
<p translate>Example Usage</p>
<pre>curl -X GET \
'{$:: getHost() $}/api/v2/version/' \
'{$:: getHost() $}/api/version/' \
-H 'Accept: application/json' \
-u {$ user.email.toLowerCase() + ':' + user.api_key $}</pre>
</div>
Expand Down
4 changes: 2 additions & 2 deletions seed/tests/api/test_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def export_data(header, main_url, organization_id, cycle_id, log):
'profile_id': None,
'export_type': 'csv',
}
result = requests.post(main_url + '/api/v2.1/tax_lot_properties/export/',
result = requests.post(main_url + '/api/v3/tax_lot_properties/export/',
headers=header,
params=params,
json=payload)
Expand Down Expand Up @@ -612,7 +612,7 @@ def export_data(header, main_url, organization_id, cycle_id, log):
'profile_id': None,
'export_type': 'csv',
}
result = requests.post(main_url + '/api/v2.1/tax_lot_properties/export/',
result = requests.post(main_url + '/api/v3/tax_lot_properties/export/',
headers=header,
params=params,
json=payload)
Expand Down
8 changes: 4 additions & 4 deletions seed/tests/test_tax_lot_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_csv_export(self):
columns.append(c['name'])

# call the API
url = reverse_lazy('api:v2.1:tax_lot_properties-export')
url = reverse_lazy('api:v3:tax_lot_properties-export')
response = self.client.post(
url + '?{}={}&{}={}&{}={}'.format(
'organization_id', self.org.pk,
Expand Down Expand Up @@ -123,7 +123,7 @@ def test_csv_export_with_notes(self):
columns.append(c['name'])

# call the API
url = reverse_lazy('api:v2.1:tax_lot_properties-export')
url = reverse_lazy('api:v3:tax_lot_properties-export')
response = self.client.post(
url + '?{}={}&{}={}&{}={}'.format(
'organization_id', self.org.pk,
Expand Down Expand Up @@ -159,7 +159,7 @@ def test_xlxs_export(self):
columns.append(c['name'])

# call the API
url = reverse_lazy('api:v2.1:tax_lot_properties-export')
url = reverse_lazy('api:v3:tax_lot_properties-export')
response = self.client.post(
url + '?{}={}&{}={}&{}={}'.format(
'organization_id', self.org.pk,
Expand Down Expand Up @@ -191,7 +191,7 @@ def test_json_export(self):
columns.append(c['name'])

# call the API
url = reverse_lazy('api:v2.1:tax_lot_properties-export')
url = reverse_lazy('api:v3:tax_lot_properties-export')
response = self.client.post(
url + '?{}={}&{}={}&{}={}'.format(
'organization_id', self.org.pk,
Expand Down

0 comments on commit 242952e

Please sign in to comment.