onadata.apps.main package

Subpackages

Submodules

onadata.apps.main.backends module

A custom ModelBackend class module.

class onadata.apps.main.backends.ModelBackend

Bases: ModelBackend

A custom ModelBackend class

authenticate(request, username=None, password=None, **kwargs)

Username is case insensitive. Supports using email in place of username

onadata.apps.main.context_processors module

google_analytics and site_name context processor functions.

onadata.apps.main.context_processors.google_analytics(request)

Returns Google Analytics property id, domain and site verification settings.

onadata.apps.main.context_processors.site_name(request)

Returns the SITE_NAME/

onadata.apps.main.forms module

forms module.

class onadata.apps.main.forms.AccountPasswordResetForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: PasswordResetForm

PasswordResetForm that enforces onadata account rules.

  • Excludes organization accounts: organization User rows are created without a real password but pass Django’s has_usable_password() check (an empty-string hash is “usable”), so the stock form would let whoever controls the organization’s email set a login password on the shared account.

  • Rate-limits reset emails per email address, mirroring the limits the removed /api/v1/user/reset endpoint enforced. Over-limit requests still render the generic success page so the limiter can’t be used to probe which emails exist.

base_fields = {'email': <django.forms.fields.EmailField object>}
declared_fields = {'email': <django.forms.fields.EmailField object>}
get_users(email)

Given an email, return matching user(s) who should receive a reset.

This allows subclasses to more easily customize the default policies that prevent inactive users and users with unusable passwords from resetting their password.

property media

Return all media required to render the widgets on this form.

save(*args, **kwargs)

Generate a one-use only link for resetting password and send it to the user.

onadata.apps.main.forms.ActivateSMSSupportFom

alias of ActivateSMSSupportForm

class onadata.apps.main.forms.ActivateSMSSupportForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

Enable SMS support form.

base_fields = {'enable_sms_support': <django.forms.fields.TypedChoiceField object>, 'sms_id_string': <django.forms.fields.CharField object>}
clean_sms_id_string()

SMS id_string validation.

declared_fields = {'enable_sms_support': <django.forms.fields.TypedChoiceField object>, 'sms_id_string': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.DataLicenseForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

” Data license form.

base_fields = {'value': <django.forms.fields.ChoiceField object>}
declared_fields = {'value': <django.forms.fields.ChoiceField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.ExternalExportForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

XLS reports form.

base_fields = {'template_name': <django.forms.fields.CharField object>, 'template_token': <django.forms.fields.URLField object>}
declared_fields = {'template_name': <django.forms.fields.CharField object>, 'template_token': <django.forms.fields.URLField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.FormLicenseForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

Form license form.

base_fields = {'value': <django.forms.fields.ChoiceField object>}
declared_fields = {'value': <django.forms.fields.ChoiceField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.LoginLockoutAuthenticationForm(request=None, *args, **kwargs)

Bases: AuthenticationForm

Authentication form that enforces the failed-login lockout.

Mirrors the lockout enforced by the digest authentication flow (onadata.libs.authentication): blocks all logins while locked out, counts failed attempts and triggers a lockout (and lockout email) once MAX_LOGIN_ATTEMPTS is reached, keyed on IP + username.

base_fields = {'password': <django.forms.fields.CharField object>, 'username': <django.contrib.auth.forms.UsernameField object>}
clean()

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

declared_fields = {'password': <django.forms.fields.CharField object>, 'username': <django.contrib.auth.forms.UsernameField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.MapboxLayerForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

Mapbox layers form.

base_fields = {'attribution': <django.forms.fields.CharField object>, 'link': <django.forms.fields.URLField object>, 'map_name': <django.forms.fields.CharField object>}
declared_fields = {'attribution': <django.forms.fields.CharField object>, 'link': <django.forms.fields.URLField object>, 'map_name': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.MediaForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

Media file upload form.

base_fields = {'media': <django.forms.fields.FileField object>}
clean_media()

Validate media upload file.

declared_fields = {'media': <django.forms.fields.FileField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.PermissionForm(username)

Bases: Form

Permission assignment form.

base_fields = {'for_user': <django.forms.fields.CharField object>, 'perm_type': <django.forms.fields.ChoiceField object>}
declared_fields = {'for_user': <django.forms.fields.CharField object>, 'perm_type': <django.forms.fields.ChoiceField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.QuickConverter(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: QuickConverterFile, QuickConverterURL, QuickConverterDropboxURL, QuickConverterTextXlsForm, QuickConverterCsvFile, QuickConverterXmlFile, QuickConverterFloipFile

Publish XLSForm and convert to XForm.

base_fields = {'csv_url': <django.forms.fields.URLField object>, 'dropbox_xls_url': <django.forms.fields.URLField object>, 'floip_file': <django.forms.fields.FileField object>, 'project': <django.forms.fields.IntegerField object>, 'text_xls_form': <django.forms.fields.CharField object>, 'xls_file': <django.forms.fields.FileField object>, 'xls_url': <django.forms.fields.URLField object>, 'xml_file': <django.forms.fields.FileField object>}
clean_project()

Project validation.

declared_fields = {'csv_url': <django.forms.fields.URLField object>, 'dropbox_xls_url': <django.forms.fields.URLField object>, 'floip_file': <django.forms.fields.FileField object>, 'project': <django.forms.fields.IntegerField object>, 'text_xls_form': <django.forms.fields.CharField object>, 'xls_file': <django.forms.fields.FileField object>, 'xls_url': <django.forms.fields.URLField object>, 'xml_file': <django.forms.fields.FileField object>}
property media

Return all media required to render the widgets on this form.

publish(user, id_string=None, created_by=None)

Publish XLSForm.

validate = <django.core.validators.URLValidator object>
class onadata.apps.main.forms.QuickConverterCsvFile(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

Uploads CSV XLSForm.

base_fields = {'csv_url': <django.forms.fields.URLField object>}
declared_fields = {'csv_url': <django.forms.fields.URLField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.QuickConverterDropboxURL(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

Uploads XLSForm from Dropbox.

base_fields = {'dropbox_xls_url': <django.forms.fields.URLField object>}
declared_fields = {'dropbox_xls_url': <django.forms.fields.URLField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.QuickConverterFile(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

Uploads XLSForm form.

base_fields = {'xls_file': <django.forms.fields.FileField object>}
declared_fields = {'xls_file': <django.forms.fields.FileField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.QuickConverterFloipFile(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

Uploads a FLOIP results data package descriptor file.

base_fields = {'floip_file': <django.forms.fields.FileField object>}
declared_fields = {'floip_file': <django.forms.fields.FileField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.QuickConverterTextXlsForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

Uploads Text XLSForm.

base_fields = {'text_xls_form': <django.forms.fields.CharField object>}
declared_fields = {'text_xls_form': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.QuickConverterURL(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

Uploads XLSForm from a URL.

base_fields = {'xls_url': <django.forms.fields.URLField object>}
declared_fields = {'xls_url': <django.forms.fields.URLField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.QuickConverterXmlFile(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

Uploads an XForm XML.

base_fields = {'xml_file': <django.forms.fields.FileField object>}
declared_fields = {'xml_file': <django.forms.fields.FileField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.RecoveryCodeForm(user, initial_device, **kwargs)

Bases: BackupTokenForm

Recovery-code step of the login wizard.

StaticToken.random_token lowercases its base32, and the library compares the submitted code exactly, so a keyboard that autocapitalises turns a valid code into a wrong one. Folded here and on the API, so the two doors do not disagree about the same code.

The library’s “Invalid token” also names neither recovery codes nor their single use, which is the whole question a user has at this point.

base_fields = {'otp_token': <django.forms.fields.CharField object>}
clean_otp_token()

Normalise to the stored form. CharField has already stripped it.

declared_fields = {'otp_token': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

otp_error_messages = {'challenge_exception': 'Error generating challenge: {0}', 'challenge_message': 'OTP Challenge: {0}', 'invalid_token': 'That recovery code is invalid or has already been used. Each code works once, so try one you have not used yet, or check for a typo.', 'n_failed_attempts': '', 'not_interactive': 'The selected OTP device is not interactive', 'token_required': 'Please enter your OTP token.', 'verification_not_allowed': 'Verification of the token is currently disabled'}
class onadata.apps.main.forms.RegistrationFormUserProfile(*args, **kwargs)

Bases: RegistrationFormUniqueEmail, UserProfileFormRegister

User profile registration form.

RESERVED_USERNAMES = []
base_fields = {'city': <django.forms.fields.CharField object>, 'country': <django.forms.fields.ChoiceField object>, 'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'home_page': <django.forms.fields.CharField object>, 'last_name': <django.forms.fields.CharField object>, 'organization': <django.forms.fields.CharField object>, 'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>, 'twitter': <django.forms.fields.CharField object>, 'username': <django.forms.fields.CharField object>}
clean_username()

Validate a new user username.

declared_fields = {'city': <django.forms.fields.CharField object>, 'country': <django.forms.fields.ChoiceField object>, 'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'home_page': <django.forms.fields.CharField object>, 'last_name': <django.forms.fields.CharField object>, 'organization': <django.forms.fields.CharField object>, 'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>, 'twitter': <django.forms.fields.CharField object>, 'username': <django.forms.fields.CharField object>}
legal_usernames_re = re.compile('^(?!.*\\.(?:json|csv|xls|xlsx|kml)$)(?:[\\w.-]+|\\+?[\\d.\\-]+|[\\w.%+-]+@[\\w.-]+\\.[a-zA-Z]{2,})$')
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.SourceForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

Source document form.

base_fields = {'source': <django.forms.fields.FileField object>}
declared_fields = {'source': <django.forms.fields.FileField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.SupportDocForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

Supporting document.

base_fields = {'doc': <django.forms.fields.FileField object>}
declared_fields = {'doc': <django.forms.fields.FileField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.UserProfileForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)

Bases: ModelForm

User profile form base class.

class Meta

Bases: object

exclude = ('user', 'created_by', 'num_of_submissions')
model

alias of UserProfile

base_fields = {'address': <django.forms.fields.CharField object>, 'city': <django.forms.fields.CharField object>, 'country': <django.forms.fields.TypedChoiceField object>, 'description': <django.forms.fields.CharField object>, 'email': <django.forms.fields.EmailField object>, 'home_page': <django.forms.fields.CharField object>, 'metadata': <django.forms.fields.JSONField object>, 'name': <django.forms.fields.CharField object>, 'organization': <django.forms.fields.CharField object>, 'phonenumber': <django.forms.fields.CharField object>, 'require_auth': <django.forms.fields.BooleanField object>, 'twitter': <django.forms.fields.CharField object>}
clean_metadata()

Returns an empty dict if metadata is None.

declared_fields = {'email': <django.forms.fields.EmailField object>}
property media

Return all media required to render the widgets on this form.

class onadata.apps.main.forms.UserProfileFormRegister(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)

Bases: Form

User profile registration form.

base_fields = {'city': <django.forms.fields.CharField object>, 'country': <django.forms.fields.ChoiceField object>, 'first_name': <django.forms.fields.CharField object>, 'home_page': <django.forms.fields.CharField object>, 'last_name': <django.forms.fields.CharField object>, 'organization': <django.forms.fields.CharField object>, 'twitter': <django.forms.fields.CharField object>}
declared_fields = {'city': <django.forms.fields.CharField object>, 'country': <django.forms.fields.ChoiceField object>, 'first_name': <django.forms.fields.CharField object>, 'home_page': <django.forms.fields.CharField object>, 'last_name': <django.forms.fields.CharField object>, 'organization': <django.forms.fields.CharField object>, 'twitter': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

save_user_profile(new_user)

Creates and returns a new_user profile.

onadata.apps.main.forms.get_filename(response)

Get filename from a Content-Disposition header.

onadata.apps.main.forms.increment_password_reset_attempts(email)

Increment and return the password reset attempts for an email.

onadata.apps.main.forms.lockout_validation_error()

The error shown once an account is locked out.

Module level because both wizard steps raise it – the credentials form below and the token forms wrapped in two_factor_views – and the two must not drift into telling a locked-out user different things.

onadata.apps.main.forms.password_reset_attempt_cache_key(email)

Return the cache key for password reset attempts for an email.

onadata.apps.main.registration_urls module

URLConf for Django user registration and authentication.

Recommended usage is a call to include() in your project’s root URLConf to include this URLConf for any URL beginning with /accounts/.

onadata.apps.main.registration_views module

FHRegistrationView class module.

class onadata.apps.main.registration_views.FHRegistrationView(**kwargs)

Bases: RegistrationView

A custom RegistrationView.

register(form)

Given a username, email address and password, register a new user account, which will initially be inactive.

Along with the new User object, a new registration.models.RegistrationProfile will be created, tied to that User, containing the activation key which will be used for this account.

An email will be sent to the supplied email address; this email should contain an activation link. The email will be rendered using two templates. See the documentation for RegistrationProfile.send_activation_email() for information about these templates and the contexts provided to them.

After the User and RegistrationProfile are created and the activation email is sent, the signal registration.signals.user_registered will be sent, with the new User as the keyword argument user and the class of this backend as the sender.

class onadata.apps.main.registration_views.TokenRotatingPasswordResetConfirmView(**kwargs)

Bases: PasswordResetConfirmView

PasswordResetConfirmView that rotates API/temp tokens on a successful reset.

Django’s stock view only changes the password. Since the API’s own reset-confirm endpoint (which used to call invalidate_and_regen_tokens) has been removed, this is now the only place a reset completes, so it must invalidate the user’s existing DRF/temp tokens itself; otherwise they’d keep working after a password reset.

form_valid(form)

If the form is valid, redirect to the supplied URL.

onadata.apps.main.signals module

signal module.

onadata.apps.main.signals.accept_project_invitation(sender, instance=None, created=False, **kwargs)

Accept project invitations that match user email

onadata.apps.main.signals.send_activation_email(sender, instance=None, **kwargs)

Sends activation email to user.

onadata.apps.main.signals.send_inactive_user_email(sender, instance=None, created=False, **kwargs)

Sends email to inactive user upon account creation.

onadata.apps.main.signals.set_api_permissions(sender, instance=None, created=False, **kwargs)

Sets API permissions for a user.

onadata.apps.main.urls module

URLs path.

onadata.apps.main.views module

Main views.

class onadata.apps.main.views.LockoutTokenView(**kwargs)

Bases: TokenView

OAuth2 token endpoint with failed-login lockout on the password grant.

The Resource Owner Password Credentials grant accepts a username + password and is otherwise brute-forceable with no lockout. The lockout reuses the same IP + username machinery as the other password flows (digest, basic, the web login form), so attempts accumulate against a single counter. Other grants (authorization_code, client_credentials, refresh_token, device_code) do not submit a user password and pass straight through.

post(request, *args, **kwargs)
class onadata.apps.main.views.OnaAuthorizationView(**kwargs)

Bases: AuthorizationView

Overrides the AuthorizationView provided by oauth2_provider and adds the user to the context

get_context_data(**kwargs)

Adds user and request_path to context and returns the context.

onadata.apps.main.views.about_us(request)

The about us page view

onadata.apps.main.views.activity(request, username)

The activity/audit view for the given username.

onadata.apps.main.views.activity_api(request, username)

Returns Audit activity data in JSON format

onadata.apps.main.views.activity_fields(request)

Returns Activity/Audit fields in JSON format.

onadata.apps.main.views.api(request, username=None, id_string=None)

Returns all results as JSON. If a parameter string is passed, it takes the ‘query’ parameter, converts this string to a dictionary, an that is then used as a MongoDB query string.

NOTE: only a specific set of operators are allow, currently $or and $and. Please send a request if you’d like another operator to be enabled.

NOTE: Your query must be valid JSON, double check it here, http://json.parser.online.fr/

E.g. api?query=’{“last_name”: “Smith”}’

onadata.apps.main.views.api_token(request, username=None)

Show user’s API Token page view.

onadata.apps.main.views.clone_xlsform(request, username)

Copy a public/Shared form to a users list of forms. Eliminates the need to download Excel File and upload again.

onadata.apps.main.views.dashboard(request)

Show the dashboard page view.

onadata.apps.main.views.delete_data(request, username=None, id_string=None)

Delete submission record.

onadata.apps.main.views.delete_metadata(request, username, id_string, data_id)

Deletes a metadata record.

onadata.apps.main.views.download_media_data(request, username, id_string, data_id)

Redirects to a form metadata record for download.

onadata.apps.main.views.download_metadata(request, username, id_string, data_id)

Downloads metadata file contents.

onadata.apps.main.views.edit(request, username, id_string)

Edit form page view.

onadata.apps.main.views.enketo_preview(request, username, id_string)

Redirects a user to the Enketo preview URL for the given form id_string.

onadata.apps.main.views.faq(request)

The frequently asked questions page view.

Return a list of urls for all the shared xls files. This could be made a lot prettier.

onadata.apps.main.views.form_photos(request, username, id_string)

View form image attachments.

onadata.apps.main.views.getting_started(request)

The getting started page view.

onadata.apps.main.views.home(request)

Default landing view.

onadata.apps.main.views.login_redirect(request)

Redirects a user to their profile page on successful login.

onadata.apps.main.views.members_list(request)

Show members list page view.

onadata.apps.main.views.privacy(request)

The privacy page view.

onadata.apps.main.views.profile(request, username)

Show user profiles page view.

onadata.apps.main.views.profile_settings(request, username)

User profile settings page view.

onadata.apps.main.views.public_api(request, username, id_string)

Returns public information about the form as JSON

onadata.apps.main.views.public_profile(request, username)

Show user’s public profile page view.

onadata.apps.main.views.qrcode(request, username, id_string)

Returns the Enketo URL in QR code image format.

Redirects to the public link of the form.

onadata.apps.main.views.resources(request)

The resources page view.

onadata.apps.main.views.serve_media(request, path)

Serves a MEDIA_ROOT file only after object-level permission checks.

Every file under MEDIA_ROOT belongs to a known owner object — a submission attachment (or one of its thumbnails), an uploaded XLSForm, a form/project media document or an export — and a request must pass that object’s permission checks before the file is served.

onadata.apps.main.views.service_health(request)

This endpoint checks whether the various services(Database, Cache, e.t.c ) of the application are running as expected. Returns a 200 Status code if all is well and a 500 if a service is down

onadata.apps.main.views.set_perm(request, username, id_string)

Assign form permissions to a user.

onadata.apps.main.views.set_xform_owner_data(data, xform, request, username, id_string)

Set xform owner page view.

onadata.apps.main.views.show(request, username=None, id_string=None, uuid=None)

Show form page view.

onadata.apps.main.views.support(request)

The support page view.

onadata.apps.main.views.syntax(request)

The XLSForm Syntax page view.

onadata.apps.main.views.tos(request)

The terms of service page view.

onadata.apps.main.views.tutorial(request)

The tutorial page view.

onadata.apps.main.views.update_xform(request, username, id_string)

Update a form page view.

onadata.apps.main.views.username_list(request)

Show’s the list of usernames.

onadata.apps.main.views.xls2xform(request)

The XLSForm to XForm page view.

onadata.apps.main.wsgi module

Module contents