Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,8 @@ repos:
rev: v8.24.3
hooks:
- id: gitleaks

- repo: https://github.com/crate-ci/typos
rev: v1.31.1
hooks:
- id: typos
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Translate Hypha in to your own language

There are two resons organisations make use of translations. They need Hypha in another language, like Spanish or Chinese. Another common need is to translate Hypha to suit a organisations vocabulary. A combination of both works as well of course.
There are two reasons organisations make use of translations. They need Hypha in another language, like Spanish or Chinese. Another common need is to translate Hypha to suit a organisations vocabulary. A combination of both works as well of course.

Our team is currently using [Weblate](https://weblate.org/) to manage translations of this project. Please visit Hypha's Weblate https://hosted.weblate.org/projects/hypha/ to start the translation process. You will need a Weblate account, and take it from there. [Weblate instructions and related documentation](https://docs.weblate.org/en/latest/user/basic.html) on translation is a great introductory resource. project on Weblate to contribute. If you are experiencing issues while you are working on translations, please open an issue on \[GitHub}.

Expand Down Expand Up @@ -46,7 +46,7 @@ It is the `django.po` file that contain all the translations. You can start to t

If you already have a translated version, replace that files with the generated one. Make sure the name and path stay the same.

It is then nessesery to complile the .po files in to binary .mo files. This command takes care of that.
It is then necessary to compile the .po files in to binary .mo files. This command takes care of that.

```shell
python manage.py compilemessages --ignore .venv
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/contributing/submitting-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ We use pull requests for all changes. No commits are done directly in to the mai

### Creating a new branch from main

First check out main and do a git pull ot get all the latest updates.
First check out main and do a git pull to get all the latest updates.

Then create a new branch and do a checkout of it.

Expand Down
2 changes: 1 addition & 1 deletion docs/references/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Color was used as the only visual means of conveying information, indicating an
#### Visual presentation
It was noted in the report that the colors of user interface components needed to have more contrast with each other. The contrast of text to background (both for the contrast minimum and contrast enhanced) was increased as a result.

#### Keyboard accessiblity
#### Keyboard accessibility
The report found that almost all functionality of the content is operable through a keyboard interface, but in order to comply with this requirement 100%, `ContentEditable` (text editor) needs to be made accessible with a keyboard.

#### Name, role, value
Expand Down
2 changes: 1 addition & 1 deletion docs/references/workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Once an application is submitted (`INITIAL_STATE`) — it can transition into th

This workflow is a single stage process with an advisory council review or external review stage -- includes functionalties for external reviewers like advisory board members to access applications and submit reviews.

It is very simlar to the "Request with external review" workflow, see below, but the internal and external review step happens at the same step.
It is very similar to the "Request with external review" workflow, see below, but the internal and external review step happens at the same step.

Beware if you opt to customise the "Reviewer Settings" (in Wagtail admin). Only the "All states" option in the "State" setting will work with this workflow.

Expand Down
2 changes: 1 addition & 1 deletion docs/setup/administrators/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Be default Hypha looks for a database with the name "hypha". Set `APP_NAME` to c
----
Language code in standard language id format: en, en-gb, en-us

The corrosponding locale dir is named: en, en_GB, en_US
The corresponding locale dir is named: en, en_GB, en_US

LANGUAGE_CODE = env.str('LANGUAGE_CODE', 'en')

Expand Down
2 changes: 1 addition & 1 deletion docs/setup/deployment/development/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ To start the docker containers you use the "up --watch" command. This command yo
docker compose --file docker/compose.yaml up --watch
```

This will run "npm watch" as well as the "runserver_plus". All code changes to hypha will be synced in to the conatiner thanks to the docker watch functionality.
This will run "npm watch" as well as the "runserver_plus". All code changes to hypha will be synced in to the container thanks to the docker watch functionality.

### Access the docker environment

Expand Down
4 changes: 2 additions & 2 deletions docs/setup/deployment/development/stand-alone.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ NOTE: In production media is stored on AWS S3 but for local development you need
uv sync
```

This vill create a `.venv` directory (if it does not exist) and install all python dependencies there.
This will create a `.venv` directory (if it does not exist) and install all python dependencies there.

All `uv …` commands will automatically use this virtual envionment.
All `uv …` commands will automatically use this virtual environment.

If you want other commands to use it you need to run this command to activate it.

Expand Down
2 changes: 1 addition & 1 deletion hypha/apply/activity/tests/test_messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test_doesnt_send_a_message_if_not_configured(self):

self.adapter.send_message.assert_not_called()

def test_calls_method_if_avaliable(self):
def test_calls_method_if_available(self):
method_name = "new_method"
return_message = "Returned message"
setattr(self.adapter, method_name, lambda **kw: return_message)
Expand Down
4 changes: 2 additions & 2 deletions hypha/apply/dashboard/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ def test_cannot_see_submission_in_determination_when_not_lead(self):
ApplicationSubmissionFactory(
status="concept_review_discussion",
workflow_stages=2,
form_data__title="Reviewr",
form_data__title="Reviewer",
)
response = self.get_page()
self.assertNotContains(response, "Reviewr")
self.assertNotContains(response, "Reviewer")

def test_waiting_for_review_with_count(self):
submission = ApplicationSubmissionFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
{% endblock %}

{% block form_buttons %}
<button class="button button--submit button--top-space button--primary" type="submit" onclick="return confirm('{% blocktrans %}This determination message will be emailed to applicants and cannot be undone. Do you wish to contiune?{% endblocktrans %}')">
<button class="button button--submit button--top-space button--primary" type="submit" onclick="return confirm('{% blocktrans %}This determination message will be emailed to applicants and cannot be undone. Do you wish to continue?{% endblocktrans %}')">
{% trans "Send" %}
</button>
{% endblock %}
Expand Down
4 changes: 2 additions & 2 deletions hypha/apply/funds/management/commands/sanitize_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@


class Command(BaseCommand):
help = "Sanitizes the reviews, submissions, and users of identifiable inforamtion"
help = "Sanitizes the reviews, submissions, and users of identifiable information"

def add_arguments(self, parser):
parser.add_argument(
Expand Down Expand Up @@ -119,7 +119,7 @@ def update_text_data():
update_data(self.f.name())
elif (
form_field.value["field_label"].lower()
== "ein (for us-based organizations)"
== "in (for us-based organizations)"
):
update_data(self.f.ssn())
elif form_field.value["field_label"].lower() == "additional contact email":
Expand Down
4 changes: 2 additions & 2 deletions hypha/apply/funds/models/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def order_by_end_date(self):
ratelimit(key="ip", rate=settings.DEFAULT_RATE_LIMIT, method="POST"), name="serve"
)
class ApplicationBase(EmailForm, WorkflowStreamForm): # type: ignore
is_createable = False
is_creatable = False

# Adds validation around forms & workflows. Isn't on Workflow class due to not displaying workflow field on Round
base_form_class = WorkflowFormAdminForm
Expand Down Expand Up @@ -556,7 +556,7 @@ def serve(self, request, *args, **kwargs):
ratelimit(key="ip", rate=settings.DEFAULT_RATE_LIMIT, method="POST"), name="serve"
)
class LabBase(EmailForm, WorkflowStreamForm, SubmittableStreamForm): # type: ignore
is_createable = False
is_creatable = False
submission_class = ApplicationSubmission

# Adds validation around forms & workflows.
Expand Down
4 changes: 2 additions & 2 deletions hypha/apply/funds/models/submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ class ApplicationSubmissionMetaclass(AddTransitions):
def __new__(cls, name, bases, attrs, **kwargs):
cls = super().__new__(cls, name, bases, attrs, **kwargs)

# We want to access the redered display of the required fields.
# We want to access the rendered display of the required fields.
# Treat in similar way to django's get_FIELD_display
for block_name in NAMED_BLOCKS:
partial_method_name = f"_{block_name}_method"
Expand Down Expand Up @@ -685,7 +685,7 @@ def create_revision(
draft: if the revision is a draft
force: force a revision even if form data is the same
by: the author of the revision
preview: if the revision is being used to save befor a preview
preview: if the revision is being used to save before a preview

Returns:
Returns the [`ApplicationRevision`][hypha.apply.funds.models.ApplicationRevision] if it was created, otherwise returns `None`
Expand Down
Empty file removed hypha/apply/funds/notificaitons.py
Empty file.
2 changes: 1 addition & 1 deletion hypha/apply/funds/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ def test_lead_can_change_role_reviewer_and_review_remains(self):
# Make sure that the ex-role-reviewer is still assigned record
self.assertCountEqual(submission.reviewers.all(), self.staff[0:2])

def test_can_be_made_role_and_not_duplciated(self):
def test_can_be_made_role_and_not_duplicated(self):
submission = ApplicationSubmissionFactory()

ReviewFactory(
Expand Down
2 changes: 1 addition & 1 deletion hypha/apply/funds/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def is_filter_empty(filter: filters.FilterSet) -> bool:
def get_copied_form_name(original_form_name: str) -> str:
"""Create the name of the form to be copied

By default, takes the orginal forms name and adds `(Copied on %Y-%m-%d %H:%M:%S.%f)`
By default, takes the original forms name and adds `(Copied on %Y-%m-%d %H:%M:%S.%f)`

If a timestamp exists on the original_form_name, it will be replaced.
This works even if the `Copied on` string is translated.
Expand Down
2 changes: 1 addition & 1 deletion hypha/apply/funds/views/submission_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ class PartnerSubmissionEditView(ApplicantSubmissionEditView):
def dispatch(self, request, *args, **kwargs):
submission = self.get_object()
# If the requesting user submitted the application, return the Applicant view.
# Partners may somtimes be applicants as well.
# Partners may sometimes be applicants as well.
partner_has_access = submission.partners.filter(pk=request.user.pk).exists()
if not partner_has_access and submission.user != request.user:
raise PermissionDenied
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Migration(migrations.Migration):
model_name="projectsettings",
name="paf_approval_sequential",
field=models.BooleanField(
default=True, help_text="Uncheck it to approve PAF parallely"
default=True, help_text="Uncheck it to approve PAF parallelly"
),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Migration(migrations.Migration):
model_name="projectsettings",
name="paf_approval_sequential",
field=models.BooleanField(
default=True, help_text="Uncheck it to approve project parallely"
default=True, help_text="Uncheck it to approve project parallelly"
),
),
]
6 changes: 3 additions & 3 deletions hypha/apply/projects/models/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
]

# All invoice statuses that allows invoice to be transition directly to RESUBMITTED.
INVOICE_TRANISTION_TO_RESUBMITTED = [
INVOICE_TRANSITION_TO_RESUBMITTED = [
SUBMITTED,
RESUBMITTED,
CHANGES_REQUESTED_BY_STAFF,
Expand Down Expand Up @@ -136,7 +136,7 @@ def __str__(self):
return _("Invoice requested for {project}").format(project=self.project)

@transition(
field=status, source=INVOICE_TRANISTION_TO_RESUBMITTED, target=RESUBMITTED
field=status, source=INVOICE_TRANSITION_TO_RESUBMITTED, target=RESUBMITTED
)
def transition_invoice_to_resubmitted(self):
"""
Expand Down Expand Up @@ -177,7 +177,7 @@ def can_user_edit(self, user):

def can_user_change_status(self, user):
"""
Check user roles that can tranistion invoice status based on the current status.
Check user roles that can transition invoice status based on the current status.
"""
if not (user.is_contracting or user.is_apply_staff or user.is_finance):
return False # Users can't change status
Expand Down
6 changes: 3 additions & 3 deletions hypha/apply/projects/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def create_from_submission(cls, submission, lead=None, status=None):
)
return None

# OneToOne relations on the targetted model cannot be accessed without
# OneToOne relations on the targeted model cannot be accessed without
# an exception when the relation doesn't exist (is None). Since we
# want to fail fast here, we can use hasattr instead.
if hasattr(submission, "project"):
Expand Down Expand Up @@ -483,7 +483,7 @@ def can_send_for_approval(self):
Wrapper to expose the pending approval state

We don't want to expose a "Sent for Approval" state to the end User so
we infer it from the current status being "Comitted" and the Project
we infer it from the current status being "Committed" and the Project
being locked.
"""
correct_state = self.status == DRAFT and not self.is_locked
Expand Down Expand Up @@ -590,7 +590,7 @@ class ProjectSettings(BaseSiteSetting, ClusterableModel):
finance_gp_email = models.TextField("Finance Group Email", null=True, blank=True)
staff_gp_email = models.TextField("Staff Group Email", null=True, blank=True)
paf_approval_sequential = models.BooleanField(
default=True, help_text="Uncheck it to approve project parallely"
default=True, help_text="Uncheck it to approve project parallelly"
)

panels = [
Expand Down
2 changes: 1 addition & 1 deletion hypha/apply/projects/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ def test_editing_invoice_remove_supporting_document(self):

self.assertFalse(invoice.supporting_documents.exists())

def test_editing_invoice_keeps_supprting_document(self):
def test_editing_invoice_keeps_supporting_document(self):
project = ProjectFactory()
invoice = InvoiceFactory(project=project)
supporting_document = SupportingDocumentFactory(invoice=invoice)
Expand Down
4 changes: 2 additions & 2 deletions hypha/apply/projects/views/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
CHANGES_REQUESTED_BY_FINANCE,
CHANGES_REQUESTED_BY_STAFF,
DECLINED,
INVOICE_TRANISTION_TO_RESUBMITTED,
INVOICE_TRANSITION_TO_RESUBMITTED,
Invoice,
)
from ..models.project import Project
Expand Down Expand Up @@ -361,7 +361,7 @@ def form_valid(self, form):
response = super().form_valid(form)

if form.cleaned_data:
if self.object.status in INVOICE_TRANISTION_TO_RESUBMITTED:
if self.object.status in INVOICE_TRANSITION_TO_RESUBMITTED:
self.object.transition_invoice_to_resubmitted()
self.object.save()

Expand Down
2 changes: 1 addition & 1 deletion hypha/apply/stream_forms/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def size(self):

@property
def modification_time(self):
# Wrap in a try for local developemnt where files might not always exist.
# Wrap in a try for local developments where files might not always exist.
try:
modified_time = self.storage.get_modified_time(self.name).date()
except FileNotFoundError:
Expand Down
2 changes: 1 addition & 1 deletion hypha/apply/translate/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_translation_params(
url: the URL to extract the params from

Returns:
tuple: in the format of (\<from langauge\>, \<to language\>)
tuple: in the format of (\<from language\>, \<to language\>)

Raises:
ValueError: If `url`/`request` are not provided OR if both are provided
Expand Down
4 changes: 2 additions & 2 deletions hypha/apply/users/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ class GroupsModelMultipleChoiceField(forms.ModelMultipleChoiceField):

@classmethod
def get_group_mmcf(
cls, model_mulitple_choice_field: forms.ModelMultipleChoiceField
cls, model_multiple_choice_field: forms.ModelMultipleChoiceField
): # Handle the insertion of group help text
group_field_dict = model_mulitple_choice_field.__dict__
group_field_dict = model_multiple_choice_field.__dict__
queryset = group_field_dict[
"_queryset"
] # Pull the queryset form the group field
Expand Down
2 changes: 1 addition & 1 deletion hypha/apply/users/templates/two_factor/core/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{% elif wizard.steps.current == 'generator' %}
<p>{% blocktrans trimmed %}2FA requires a verification code to pair your smartphone with your account.
{% endblocktrans %}</p>
<p>{% blocktrans trimmed %}<strong>Step 1:</strong> Open the Authencator app on your phone and scan the QR code displayed below.
<p>{% blocktrans trimmed %}<strong>Step 1:</strong> Open the Authenticator app on your phone and scan the QR code displayed below.
{% endblocktrans %}</p>
<p><img src="{{ QR_URL }}" alt="QR Code" class="bg-white" width="200" height="200" /></p>
<p style="font-size: small">{% trans "Unable to scan the QR code? Try this link:" %} <a href="{{ otpauth_url }}" title="2FA Setup URL">{{ otpauth_url }}</a></p>
Expand Down
6 changes: 3 additions & 3 deletions hypha/cookieconsent/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ class Migration(migrations.Migration):
(
"cookieconsent_active",
models.BooleanField(
default=False, verbose_name="Activate cookie concent feature"
default=False, verbose_name="Activate cookie consent feature"
),
),
(
"cookieconsent_title",
models.CharField(
default="Your cookie settings",
max_length=255,
verbose_name="cookie concent title",
verbose_name="cookie consent title",
),
),
(
"cookieconsent_message",
wagtail.fields.RichTextField(
default='<p>This website deploys cookies for basic functionality and to keep it secure. These cookies are strictly necessary. Optional analysis cookies which provide us with statistical information about the use of the website may also be deployed, but only with your consent. Please review our <a href="/data-privacy-policy/">Privacy &amp; Data Policy</a> for more information.</p>',
verbose_name="cookie concent message",
verbose_name="cookie consent message",
),
),
(
Expand Down
4 changes: 2 additions & 2 deletions hypha/locale/django.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2205,7 +2205,7 @@ msgstr ""
#: hypha/apply/determinations/templates/determinations/batch_determination_form.html:32
msgid ""
"This determination message will be emailed to applicants and cannot be "
"undone. Do you wish to contiune?"
"undone. Do you wish to continue?"
msgstr ""

#: hypha/apply/determinations/templates/determinations/batch_determination_form.html:33
Expand Down Expand Up @@ -6595,7 +6595,7 @@ msgstr ""

#: hypha/apply/users/templates/two_factor/core/setup.html:17
msgid ""
"<strong>Step 1:</strong> Open the Authencator app on your phone and scan the "
"<strong>Step 1:</strong> Open the Authenticator app on your phone and scan the "
"QR code displayed below."
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion hypha/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
# Set LANGUAGE setting to limit the languages available.
LANGUAGE_SWITCHER = env.bool("LANGUAGE_SWITCHER", False)

# By default only English is activ.
# By default only English is active.
# When LANGUAGE_SWITCHER is on we activate all the languages there are complete translations for.
if LANGUAGE_SWITCHER:
LANGUAGES = [
Expand Down
2 changes: 1 addition & 1 deletion hypha/static_src/javascript/batch-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
// see how many checkboxes are :checked
toggleBatchActions();

// updates selected checbox count
// updates selected checkbox count
updateCount();

// reset the check all input
Expand Down
Loading
Loading