Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python3 and Django2.2 upgrade] part 1 - Remove unused code and make tests pass again #607

Merged
merged 106 commits into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
32bd065
wip: seeing red
jnm Jul 24, 2019
2f2603d
Allow the MetaData list to be filtered by type
noliveleger Dec 19, 2019
929f2f5
- Delete file from storage on MetaData object deletion
noliveleger Dec 19, 2019
8ee8c0e
Upload media files to XForm id_string subfolder
noliveleger Dec 19, 2019
dae2320
Removed useless import
noliveleger Dec 19, 2019
8fb3ba6
Merge branch '2155_kpi_two_databases' into kobokitten
noliveleger Mar 10, 2020
0c53edd
- Added utf-8 code header to config files
noliveleger Mar 10, 2020
62f3e46
Added pytest to dev settings
noliveleger Mar 10, 2020
3d3b733
Removed ZiggyInstance
noliveleger Mar 10, 2020
8c96e36
Added utf8 code header and reorganized some imports
noliveleger Mar 10, 2020
675132c
Fixed bad urls of objects in AttachmentSerializer, added large attach…
noliveleger Mar 10, 2020
6c250dd
Block users to list all other users
noliveleger Mar 10, 2020
739fac0
WIP - Fixed API unit tests
noliveleger Mar 10, 2020
7ae349f
Merge branch '2155_kpi_two_databases' into kobokitten
noliveleger Mar 12, 2020
773c90e
Removed "src" from comitted files
noliveleger Mar 13, 2020
877fe78
reraise error when saving instance to let OpenRosa Sever handle the e…
noliveleger Mar 13, 2020
fc50966
Make API unittests run again
noliveleger Mar 17, 2020
9d53b2b
Unprojectified API unit tests
noliveleger Mar 17, 2020
1ae3d2c
Added skipped unit tests on XformViewSet
noliveleger Mar 18, 2020
ae451c7
Reorganized imports, applied kobo coding rules few places
noliveleger Mar 18, 2020
a03c0a7
'DataDictionary.set_uuid_in_xml' uses 'id_string' as root node if pro…
noliveleger Mar 18, 2020
0db51ac
Fixed unit test for XForm xml export
noliveleger Mar 18, 2020
536576c
Merge branch '601-enforce-note-permissions' into kobokitten
noliveleger Mar 19, 2020
1065f3f
Removed 'public' shortcut for public forms and data endpoints
noliveleger Mar 19, 2020
e62a4c9
Simplified forms and data permissions. Anonymous user can't list publ…
noliveleger Mar 19, 2020
98ae251
Changed "fixtures/Transportation Form.xml" to be compliant with new v…
noliveleger Mar 20, 2020
9dbcc49
Made last skipped API unit tests pass
noliveleger Mar 20, 2020
7e75ba2
Removed Bamboo refs and created migration (+ ZiggyInstance removal)
noliveleger Mar 20, 2020
471b56a
Removed bamboo dataset reference in templates
noliveleger Apr 7, 2020
d8da35a
Skipped tests on user profile (delegated to KPI)
noliveleger Apr 7, 2020
bab354e
Fixed bug when uploaded a form with a name which already exists
noliveleger Apr 7, 2020
1934e7b
Misc tiny bug fixes for unittests
noliveleger Apr 7, 2020
bf2eee3
Merge branch '2155_kpi_two_databases' into kobokitten
noliveleger Apr 7, 2020
7379465
Use MongoMock as mongoclient in test environment
noliveleger Apr 7, 2020
03a9ab0
Fixed Pandas bridge unit tests
noliveleger Apr 7, 2020
17e2448
Fixed exports unit tests
noliveleger Apr 7, 2020
e1fa1db
Pre-Python3.7 upgrade: Renamed "async" argument to "asynchronous"
noliveleger Apr 8, 2020
fb4449e
Fixed MockMongo issue with fsync command
noliveleger Apr 8, 2020
d8dc0f8
Fixed thumbnail creations tests
noliveleger Apr 8, 2020
ceee260
Fixed issue with MockMongo, updated some fixtures, applied PEP-8 rules
noliveleger Apr 8, 2020
7bfaa04
Removed some useless imports, applied some PEP-8 rules
noliveleger Apr 8, 2020
9cc9ccb
Added "_validation_status" field to exports in tests
noliveleger Apr 8, 2020
ccaec78
Dropped XLSreport support in metadata
noliveleger Apr 8, 2020
bda5675
Fixed rest_service unit tests
noliveleger Apr 8, 2020
d7d00b6
Skipped failing export with unicode tests
noliveleger Apr 8, 2020
d0f9f53
Support AWS storage in tests
noliveleger Apr 9, 2020
6bbabd3
Misc. typo and bug fixes in unit tests
noliveleger Apr 9, 2020
75d52ac
Cleanup storage and DB after tests. Support AWS and local storage
noliveleger Apr 10, 2020
b68e912
Added __future__ import and coding utf8
noliveleger Apr 14, 2020
46108fd
Reorganized imports and removed unicode prefix
noliveleger Apr 14, 2020
1a150d8
Fixed unicode decode errors
noliveleger Apr 15, 2020
b6d61d7
Merge branch 'kobotoolbox/tasks#341-ssrf-protection' into kobokitten
noliveleger Apr 21, 2020
caee3a7
Merge branch 'kobokitten' into kobokitten-unicode
noliveleger Apr 21, 2020
5a3e83a
Merge branch 'kpi-2487-form-media' into kobokitten-unicode
noliveleger Apr 21, 2020
d6d50af
Merge branch 'kpi-2487-form-media' into kobokitten
noliveleger Apr 21, 2020
3bbf5f8
Merge branch 'kobokitten' into kobokitten-unicode
noliveleger Apr 21, 2020
2349dc2
Merge branch 'master' into kobokitten
noliveleger Apr 30, 2020
e936fd2
Merge branch 'kobokitten' into kobokitten-unicode
noliveleger Apr 30, 2020
838d498
Merge branch '601-enforce-note-permissions' into tmp
noliveleger May 12, 2020
5259e9e
Merge branch 'kobokitten' into kobokitten-unicode
noliveleger May 12, 2020
97df506
Merge branch 'master' into kobokitten
noliveleger Jun 17, 2020
6692fed
Merge branch 'kobokitten' into kobokitten-unicode
noliveleger Jun 17, 2020
32fee77
Fixed bad merge
noliveleger Jun 18, 2020
9cdce3c
Merge branch 'kobokitten' into kobokitten-unicode
noliveleger Jun 18, 2020
c766496
Removed Users, UserProfile, User endpoints
noliveleger Jun 18, 2020
85e70a0
Fixed Forms and Data endpoints access for anonymous user
noliveleger Jun 18, 2020
9b5f95f
Merge branch 'kobokitten' into kobokitten-unicode
noliveleger Jun 18, 2020
b4c8a08
Added new migration to clean not-used models
noliveleger Jul 20, 2020
89f9a91
Merge branch 'master' into kobokitten
noliveleger Jul 23, 2020
60d6cd3
Merge branch 'kobokitten' into kobokitten-unicode
noliveleger Jul 23, 2020
a900b25
Remove test of cloning form with invalid id_string
jnm Jul 27, 2020
654d970
Remove or rewrite some obsolete tests
jnm Jul 27, 2020
447a0c5
Remove obsolete role-based permission tests
jnm Jul 27, 2020
9205092
Add safeguards against tests removing real data
jnm Jul 27, 2020
2da3acb
Entirely remove UI previously hidden by `kc-hide`
jnm Jul 27, 2020
19c5231
So long, false friend
jnm Jul 27, 2020
4019c2b
Remove unused/faulty params from `publish_xls_form`
jnm Jul 27, 2020
54afd9d
Give Alice the dignity of their own password
jnm Jul 27, 2020
0483f23
Remove unused `J2XException`
jnm Jul 27, 2020
6be0958
Remove dead code for custom mapbox layers
jnm Jul 27, 2020
90ea790
Fix/remove some tests broken by cleaning `kc-hide`
jnm Jul 27, 2020
31fed2f
Add a few test users to the cleanup list
jnm Jul 27, 2020
b801ad6
Reformat funky docstring
jnm Jul 27, 2020
3250b93
Always disable capturing in pytest setup
noliveleger Jul 27, 2020
ac86c1d
Restore `api/v1/user` endpoint 😭
jnm Jul 27, 2020
41db343
Use explicit ordering when querying with `last()`
jnm Jul 27, 2020
cd77af3
Remove stray `print`
jnm Jul 27, 2020
b117b29
Remove MongoMock `fsync` patch
jnm Jul 27, 2020
815c246
Use `isinstance()` at the cost of an extra import
jnm Jul 27, 2020
3fce6e6
Remove role-based permissions management command
jnm Jul 27, 2020
6b2a8b2
Merge branch 'kobokitten' into kobokitten-unicode
noliveleger Jul 28, 2020
7b59058
Applied requested changs for PR #608
noliveleger Aug 10, 2020
c3323e5
Merge pull request #608 from kobotoolbox/kobokitten-unicode
jnm Aug 18, 2020
469ad29
add editorconfig
magicznyleszek Sep 16, 2020
437abbe
add legacy survey bar and popup
magicznyleszek Sep 16, 2020
6686daa
fix wrongly used block
magicznyleszek Sep 17, 2020
fa7bd6b
some styles tweaks
magicznyleszek Sep 17, 2020
5b19efe
close popup on take survey button
magicznyleszek Sep 17, 2020
9ca2376
final url
magicznyleszek Sep 17, 2020
7aeae53
Merge remote-tracking branch 'origin/master' into kobokitten
jnm Sep 24, 2020
662d5f5
Add test for `formList/?formID=[id_string]`
jnm Sep 24, 2020
cbca84c
Document endpoint removals
jnm Sep 24, 2020
fb2789e
Merge pull request #651 from kobotoolbox/230-formlist-formid-paramete…
noliveleger Sep 24, 2020
3849aed
Merge pull request #652 from kobotoolbox/kobokitten-document-removals
noliveleger Sep 24, 2020
4fe92f6
Merge remote-tracking branch 'origin/kobokitten' into 647-legacy-surv…
jnm Sep 24, 2020
bdd6697
Merge pull request #649 from kobotoolbox/647-legacy-survey-popup
jnm Sep 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*.{es6,js,coffee,scss,css}]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.{html}]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ custom_template
.vagrant
Vagrantfile
ansible

/src
jnm marked this conversation as resolved.
Show resolved Hide resolved
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,18 @@ please refer to
As features are migrated, we will list them here along with the last
release where each was present:

- REST Services - an improved version [has been added to
KPI](https://github.com/kobotoolbox/kpi/pull/1864). Last KoBoCAT
- To ensure security and stability, many endpoints that were already
available in KPI, long-unsupported, or underutilized have been removed in
release
[2.020.40](https://github.com/kobotoolbox/kobocat/releases/tag/2.020.40).
These were related to charts and stats, form cloning, form sharing, user
profiles, organizations / projects / teams, bamboo, and ziggy. For a full
list, please see [REMOVALS.md](REMOVALS.md). These endpoints were last
available in the release
[2.020.39](https://github.com/kobotoolbox/kobocat/releases/tag/2.020.39).
- REST Services - an improved version [has been added to
KPI](https://github.com/kobotoolbox/kpi/pull/1864). The last KoBoCAT
release to contain legacy REST services is
[2.019.39](https://github.com/kobotoolbox/kobocat/releases/tag/2.019.39).

## About
Expand Down
106 changes: 106 additions & 0 deletions REMOVALS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# KoBoCAT endpoint removals as of release [2.020.40](https://github.com/kobotoolbox/kobocat/releases/tag/2.020.40)

The last release to contain any of the endpoints listed below was https://github.com/kobotoolbox/kobocat/releases/tag/2.020.39.

## Already available in KPI

### Charts and Stats

URL Pattern | View Class or Function | View Name
-- | -- | --
`/<username>/forms/<id_string>/stats` | `onadata.apps.viewer.views.charts` | `form-stats`
`/<username>/forms/<id_string>/tables` | `onadata.apps.viewer.views.stats_tables` |
`/api/v1/charts` | `onadata.apps.api.viewsets.charts_viewset.ChartsViewSet` | `chart-list`
`/api/v1/charts.<format>/` | `onadata.apps.api.viewsets.charts_viewset.ChartsViewSet` | `chart-list`
`/api/v1/charts/<pk>` | `onadata.apps.api.viewsets.charts_viewset.ChartsViewSet` | `chart-detail`
`/api/v1/charts/<pk>.<format>/` | `onadata.apps.api.viewsets.charts_viewset.ChartsViewSet` | `chart-detail`
`/api/v1/stats` | `onadata.apps.api.viewsets.stats_viewset.StatsViewSet` | `stats-list`
`/api/v1/stats.<format>/` | `onadata.apps.api.viewsets.stats_viewset.StatsViewSet` | `stats-list`
`/api/v1/stats/<pk>` | `onadata.apps.api.viewsets.stats_viewset.StatsViewSet` | `stats-detail`
`/api/v1/stats/<pk>.<format>/` | `onadata.apps.api.viewsets.stats_viewset.StatsViewSet` | `stats-detail`
`/api/v1/stats/submissions` | `onadata.apps.api.viewsets.submissionstats_viewset.SubmissionStatsViewSet` | `submissionstats-list`
`/api/v1/stats/submissions.<format>/` | `onadata.apps.api.viewsets.submissionstats_viewset.SubmissionStatsViewSet` | `submissionstats-list`
`/api/v1/stats/submissions/<pk>` | `onadata.apps.api.viewsets.submissionstats_viewset.SubmissionStatsViewSet` | `submissionstats-detail`
`/api/v1/stats/submissions/<pk>.<format>/` | `onadata.apps.api.viewsets.submissionstats_viewset.SubmissionStatsViewSet` | `submissionstats-detail`
`/stats/` | `onadata.apps.stats.views.stats` | `form-stats`
`/stats/submissions/` | `onadata.apps.stats.views.submissions` |

### Form Cloning

URL Pattern | View Class or Function | View Name
-- | -- | --
`/api/v1/forms/<pk>/clone` | `onadata.apps.api.viewsets.xform_viewset.XFormViewSet` | `xform-clone`
`/api/v1/forms/<pk>/clone.<format>/` | `onadata.apps.api.viewsets.xform_viewset.XFormViewSet` | `xform-clone`

### Form Sharing

URL Pattern | View Class or Function | View Name
-- | -- | --
`/api/v1/forms/<pk>/share` | `onadata.apps.api.viewsets.xform_viewset.XFormViewSet` | `xform-share`
`/api/v1/forms/<pk>/share.<format>/` | `onadata.apps.api.viewsets.xform_viewset.XFormViewSet` | `xform-share`

### User Profiles

URL Pattern | View Class or Function | View Name
-- | -- | --
`/api/v1/profiles` | `onadata.apps.api.viewsets.user_profile_viewset.UserProfileViewSet` | `userprofile-list`
`/api/v1/profiles.<format>/` | `onadata.apps.api.viewsets.user_profile_viewset.UserProfileViewSet` | `userprofile-list`
`/api/v1/profiles/<user>` | `onadata.apps.api.viewsets.user_profile_viewset.UserProfileViewSet` | `userprofile-detail`
`/api/v1/profiles/<user>.<format>/` | `onadata.apps.api.viewsets.user_profile_viewset.UserProfileViewSet` | `userprofile-detail`
`/api/v1/profiles/<user>/change_password` | `onadata.apps.api.viewsets.user_profile_viewset.UserProfileViewSet` | `userprofile-change-password`
`/api/v1/profiles/<user>/change_password.<format>/` | `onadata.apps.api.viewsets.user_profile_viewset.UserProfileViewSet` | `userprofile-change-password`
`/api/v1/user/reset` | `onadata.apps.api.viewsets.connect_viewset.ConnectViewSet` | `userprofile-reset`
`/api/v1/user/reset.<format>/` | `onadata.apps.api.viewsets.connect_viewset.ConnectViewSet` | `userprofile-reset`
`/api/v1/users` | `onadata.apps.api.viewsets.user_viewset.UserViewSet` | `user-list`
`/api/v1/users.<format>/` | `onadata.apps.api.viewsets.user_viewset.UserViewSet` | `user-list`
`/api/v1/users/<username>` | `onadata.apps.api.viewsets.user_viewset.UserViewSet` | `user-detail`
`/api/v1/users/<username>.<format>/` | `onadata.apps.api.viewsets.user_viewset.UserViewSet` | `user-detail`

## Discontinued

These endpoints existed but were neither maintained nor tested, and their features were never available in the UI. They might be added to KPI at an indeterminate future time given interest and funding.

### Organizations, Projects, and Teams

URL Pattern | View Class or Function | View Name
-- | -- | --
`/api/v1/orgs` | `onadata.apps.api.viewsets.organization_profile_viewset.OrganizationProfileViewSet` | `organizationprofile-list`
`/api/v1/orgs.<format>/` | `onadata.apps.api.viewsets.organization_profile_viewset.OrganizationProfileViewSet` | `organizationprofile-list`
`/api/v1/orgs/<user>` | `onadata.apps.api.viewsets.organization_profile_viewset.OrganizationProfileViewSet` | `organizationprofile-detail`
`/api/v1/orgs/<user>.<format>/` | `onadata.apps.api.viewsets.organization_profile_viewset.OrganizationProfileViewSet` | `organizationprofile-detail`
`/api/v1/orgs/<user>/members` | `onadata.apps.api.viewsets.organization_profile_viewset.OrganizationProfileViewSet` | `organizationprofile-members`
`/api/v1/orgs/<user>/members.<format>/` | `onadata.apps.api.viewsets.organization_profile_viewset.OrganizationProfileViewSet` | `organizationprofile-members`
`/api/v1/projects` | `onadata.apps.api.viewsets.project_viewset.ProjectViewSet` | `project-list`
`/api/v1/projects.<format>/` | `onadata.apps.api.viewsets.project_viewset.ProjectViewSet` | `project-list`
`/api/v1/projects/<pk>` | `onadata.apps.api.viewsets.project_viewset.ProjectViewSet` | `project-detail`
`/api/v1/projects/<pk>.<format>/` | `onadata.apps.api.viewsets.project_viewset.ProjectViewSet` | `project-detail`
`/api/v1/projects/<pk>/forms` | `onadata.apps.api.viewsets.project_viewset.ProjectViewSet` | `project-forms`
`/api/v1/projects/<pk>/forms.<format>/` | `onadata.apps.api.viewsets.project_viewset.ProjectViewSet` | `project-forms`
`/api/v1/projects/<pk>/labels` | `onadata.apps.api.viewsets.project_viewset.ProjectViewSet` | `project-labels`
`/api/v1/projects/<pk>/labels.<format>/` | `onadata.apps.api.viewsets.project_viewset.ProjectViewSet` | `project-labels`
`/api/v1/projects/<pk>/share` | `onadata.apps.api.viewsets.project_viewset.ProjectViewSet` | `project-share`
`/api/v1/projects/<pk>/share.<format>/` | `onadata.apps.api.viewsets.project_viewset.ProjectViewSet` | `project-share`
`/api/v1/projects/<pk>/star` | `onadata.apps.api.viewsets.project_viewset.ProjectViewSet` | `project-star`
`/api/v1/projects/<pk>/star.<format>/` | `onadata.apps.api.viewsets.project_viewset.ProjectViewSet` | `project-star`
`/api/v1/teams` | `onadata.apps.api.viewsets.team_viewset.TeamViewSet` | `team-list`
`/api/v1/teams.<format>/` | `onadata.apps.api.viewsets.team_viewset.TeamViewSet` | `team-list`
`/api/v1/teams/<pk>` | `onadata.apps.api.viewsets.team_viewset.TeamViewSet` | `team-detail`
`/api/v1/teams/<pk>.<format>/` | `onadata.apps.api.viewsets.team_viewset.TeamViewSet` | `team-detail`
`/api/v1/teams/<pk>/members` | `onadata.apps.api.viewsets.team_viewset.TeamViewSet` | `team-members`
`/api/v1/teams/<pk>/members.<format>/` | `onadata.apps.api.viewsets.team_viewset.TeamViewSet` | `team-members`

### User Profiles

URL Pattern | View Class or Function | View Name
-- | -- | --
`/api/v1/user/<user>/starred` | `onadata.apps.api.viewsets.connect_viewset.ConnectViewSet` | `userprofile-starred`
`/api/v1/user/<user>/starred.<format>/` | `onadata.apps.api.viewsets.connect_viewset.ConnectViewSet` | `userprofile-starred`

## Discontinued permanently

### Bamboo and Ziggy

URL Pattern | View Class or Function | View Name
-- | -- | --
`/<username>/forms/<id_string>/bamboo` | `onadata.apps.main.views.link_to_bamboo` |
`/<username>/form-submissions` | `onadata.apps.logger.views.ziggy_submissions` |
100 changes: 100 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# coding: utf-8
from __future__ import unicode_literals, print_function, division, absolute_import
import os
import pytest
import sys

from django.conf import settings

from onadata.libs.utils.storage import delete_user_storage, user_storage_exists

TEST_USERNAMES = [
'alice',
'auser',
'bob',
'carl',
'deno'
'harry',
'jo',
'lilly',
'peter',
]

try:
INTERRUPTED = pytest.ExitCode.INTERRUPTED # pytest 5
except AttributeError:
INTERRUPTED = 2


def stderr_prompt(message):
sys.stderr.write(message)
# FIXME: Python 3 compatibility
return raw_input().strip()


def toggle_capturing(capture_manager, stop):
if stop:
capture_manager.suspend_global_capture()
capture_manager.stop_global_capturing()
else:
capture_manager.start_global_capturing()
capture_manager.resume_global_capture()


@pytest.fixture(scope="session", autouse=True)
def setup(request):
# We need to disable global capturing in case `-s` is not passed to `pytest`
# by the users to force print the safeguard messages about data loss.
capture_manager = request.config.pluginmanager.getplugin("capturemanager")
is_global_capturing = capture_manager.is_globally_capturing()

if is_global_capturing:
toggle_capturing(capture_manager, stop=True)

for username in TEST_USERNAMES:
if user_storage_exists(username):
response = stderr_prompt(
'\n\n'
'WARNING - DATA LOSS! A storage directory already exists for '
'user {}, but it will be DELETED if you continue with these '
'tests!\nPlease type "yes" to proceed anyway, or "no" to '
'cancel: '.format(username)
)
if response.lower() != 'yes':
if is_global_capturing:
toggle_capturing(capture_manager, stop=False)
pytest.exit('User interrupted tests', INTERRUPTED)

if 'instances' in settings.MONGO_DB.collection_names():
response = stderr_prompt(
'\n\n'
'WARNING: the MongoDB collection {}.instances already exists!\n'
"Type 'yes' if you would like to delete it, or 'no' to "
'cancel: '.format(settings.MONGO_DB.name)
)
if response.lower() == 'yes':
settings.MONGO_DB.instances.drop()
else:
if is_global_capturing:
toggle_capturing(capture_manager, stop=False)
pytest.exit('User interrupted tests', INTERRUPTED)

if is_global_capturing:
toggle_capturing(capture_manager, stop=False)

request.addfinalizer(_tear_down)


def _tear_down():
print("\nCleaning testing environment...")
print('Removing MongoDB...')
settings.MONGO_DB.instances.drop()
jnm marked this conversation as resolved.
Show resolved Hide resolved

root_path = os.path.dirname(os.path.realpath(__file__))
if os.path.exists(os.path.join(root_path, 'db.sqlite3')):
print('Removing SQL DB...')
os.remove(os.path.join(root_path, 'db.sqlite3'))

print("Removing users' storage...")
for username in TEST_USERNAMES:
delete_user_storage(username)
2 changes: 2 additions & 0 deletions kobocat-template/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
{% include "topbar.html"%}

{% endif %}

{% block before-content %}{% endblock %}

<div class="container-fluid container__wide main {{ request.resolver_match.url_name }}">
{% block message %}
Expand Down
2 changes: 2 additions & 0 deletions kobocat-template/templates/data_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<link rel="stylesheet" href="{% static "bower_components/backgrid-filter/backgrid-filter.min.css" %}" />
<link rel="stylesheet" href="{% static "bower_components/backgrid-paginator/backgrid-paginator.min.css" %}" />
<link href="{% static "css/data_view.css" %}" rel="stylesheet">
{% endblock %}

{% block before-content %}
<div class="sub-header-bar">
<div class="container__wide">
<a class="sub-header__back" href="{% url "onadata.apps.main.views.show" xform.user.username xform.id_string %}"><i class="fa fa-chevron-left"></i> {% trans "Return to" %} {{ xform.title }}</a>
Expand Down
13 changes: 1 addition & 12 deletions kobocat-template/templates/export_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load static %}


{% block additional-headers %}
{% block before-content %}
{% load i18n %}

<div class="sub-header-bar">
Expand Down Expand Up @@ -46,16 +46,6 @@ <h1>{{ export_type_name|upper }} {% blocktrans %}Exports{% endblocktrans %}</h1>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>{% trans "Advanced Export" %}</h3>
</div>
{% if export_type == 'external' %}
<div class="modal-body">
<label>{% trans "Template to use for the export" %}</label>
<select id="external_export_metadata" name="meta" class="span2">
{% for meta in metas %}
<option value="{{ meta.id }}">{% trans meta.data_value %}</option>
{% endfor %}
</select>
</div>
{% else %}
<div class="modal-body">
<label>{% trans "Delimiter to use to separate group names from field names" %}</label>
<select id="options-group_delimiter" name="options[group_delimiter]" class="span2">
Expand All @@ -67,7 +57,6 @@ <h3>{% trans "Advanced Export" %}</h3>
{% trans "DONT split select multiple choice answers into separate columns" %}
</label>
</div>
{% endif %}
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">{% trans "Cancel" %}</button>
<input type="submit" class="btn large btn-primary" value="{% trans "Create Export" %}" />
Expand Down
2 changes: 1 addition & 1 deletion kobocat-template/templates/instance.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load i18n %}
{% load static %}

{% block additional-headers %}
{% block before-content %}
{% load i18n %}

<div class="sub-header-bar">
Expand Down
Loading