Skip to content

Commit

Permalink
Change public body to public agency
Browse files Browse the repository at this point in the history
  • Loading branch information
sthapa committed Nov 29, 2024
1 parent a774451 commit 1e8fabd
Show file tree
Hide file tree
Showing 104 changed files with 1,543 additions and 1,543 deletions.
10 changes: 5 additions & 5 deletions docs/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ Features
- Froide uses many of the built-in Django features like the Admin interface to
manage and update entities in the system, the internationalization
system, and the user management and authentication.
- Freedom of Information Laws and Public Entities are connected through a many-to-many relationship. That allows for a Public Body to be accountable under different laws.
- A Public Body can have a parent to represent hierarchies from the real
- Freedom of Information Laws and Public Entities are connected through a many-to-many relationship. That allows for a Public Agency to be accountable under different laws.
- A Public Agency can have a parent to represent hierarchies from the real
world. They can also be categorized into classifications (e.g. ministry, council) and topical tags (e.g. environment, military) which can be defined separately.
- Users can create requests without a Public Body so that others can
- Users can create requests without a Public Agency so that others can
suggest an appropriate recipient later.
- Requests can optionally be kept private by users and published at a
later point (e.g. after a related article has been published).
- Requests are mailed to Public Bodies through the platform via a special,
- Requests are mailed to Public Agencies through the platform via a special,
request-unique email address (using SMTP) and the platform will receive answers on
that mail address (by accessing an IMAP account).
- Search functionality for Requests and Public Bodies.
- Search functionality for Requests and Public Agencies.
- A read/write REST-API
- Redaction of PDFs

Expand Down
2 changes: 1 addition & 1 deletion docs/admin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Froide Admin
============

The Django admin exposes database objects to staff users and superusers.
Superusers have access to all objects while staff users can be given specific read/write/delete access to kinds of objects (e.g. only public bodies). Users can also given a group that has certain rights associated with it.
Superusers have access to all objects while staff users can be given specific read/write/delete access to kinds of objects (e.g. only public agencies). Users can also given a group that has certain rights associated with it.
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ inside your Froide instance.

The Froide API is available at `/api/v1/` and the interactive Froide API documentation is available at `/api/v1/docs/`.

There are additional search endpoints for Public Bodies and FOI Requests at `/api/v1/publicbody/search/` and `/api/v1/request/search/` respectively. Use `q` as the query parameter in a GET request.
There are additional search endpoints for Public Agencies and FOI Requests at `/api/v1/publicbody/search/` and `/api/v1/request/search/` respectively. Use `q` as the query parameter in a GET request.

GET requests do not need to be authenticated. POST, PUT and DELETE requests have to either carry a valid session cookie and a CSRF token or provide user name (you find your user name on your profile) and password via Basic Authentication.
18 changes: 9 additions & 9 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ The following keys in that dictionary must be present:
*boolean* Can users hide their name on the portal? Their name will always be sent with the request, but may not appear on the website.

**public_body_officials_public**
*boolean* Are the names of responding public body officials public and visible on the Web?
*boolean* Are the names of responding public agency officials public and visible on the Web?

**public_body_officials_email_public**
*boolean* Are the email addresses of public body officials public and visible on the Web?
*boolean* Are the email addresses of public agency officials public and visible on the Web?

**currency**
*string* The currency in which payments (if at all) occur
Expand Down Expand Up @@ -55,16 +55,16 @@ regexes that also find the name::
You should replace this with a list of the most common expressions in
your language.

Index Boosting of Public Bodies
Index Boosting of Public Agencies
-------------------------------

Some Public Bodies are more important and should appear first in
Some Public Agencies are more important and should appear first in
searches (if their name and description match the search terms). You can
provide a mapping of public body classifications (e.g. ministry,
provide a mapping of public agency classifications (e.g. ministry,
council etc.) to their search boost factor via the `public_body_boosts`
key in the `FROIDE_CONFIG` setting::

# boost public bodies by their classification
# boost public agencies by their classification
FROIDE_CONFIG.update(
'public_body_boosts': {
u"Ministry": 1.9,
Expand All @@ -75,7 +75,7 @@ key in the `FROIDE_CONFIG` setting::
For autocomplete search results another name schema is used. This needs
its own config too::

# boost public bodies for autocomplete
# boost public agencies for autocomplete
FROIDE_CONFIG.update(
'autocomplete_body_boosts': {
u"Ministry": 1.9
Expand All @@ -95,15 +95,15 @@ production)::
# production environment:
EMAIL_BACKEND = 'djcelery_email.backends.CeleryEmailBackend'

Define the standard Django SMTP parameters for sending regular email notifications (not FoI request emails to public bodies)::
Define the standard Django SMTP parameters for sending regular email notifications (not FoI request emails to public agencies)::

EMAIL_HOST = "smtp.example.com"
EMAIL_PORT = 587
EMAIL_HOST_USER = "[email protected]"
EMAIL_HOST_PASSWORD = "password"
EMAIL_USE_TLS = True

Also define the parameters for sending FoI-Mails to public bodies.
Also define the parameters for sending FoI-Mails to public agencies.
They might be different because they can either be sent from a fixed
address and with a special `Reply-To` field or directly from a special
address::
Expand Down
34 changes: 17 additions & 17 deletions docs/importpublicbodies.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
=======================
Importing Public Bodies
Importing Public Agencies
=======================

While it is possible to create public bodies individually through the admin
While it is possible to create public agencies individually through the admin
interface, it might be more advisable to scrape a list from a website or
crowdsource them with other people in a Google doc. You can then import these
public bodies as a CSV file into Froide.
public agencies as a CSV file into Froide.

The format of the CSV file should be like `in this Google Docs Spreadsheet <https://docs.google.com/spreadsheet/ccc?key=0AhDkodM9ozpddGNTaGJoa203aEJaRXVfM0Q0d1RjNUE#gid=0>`_. You could for example copy it and either fill in public bodies collaboratively or programmatically.
The format of the CSV file should be like `in this Google Docs Spreadsheet <https://docs.google.com/spreadsheet/ccc?key=0AhDkodM9ozpddGNTaGJoa203aEJaRXVfM0Q0d1RjNUE#gid=0>`_. You could for example copy it and either fill in public agencies collaboratively or programmatically.


Prerequisites
Expand All @@ -22,39 +22,39 @@ Format
The format is quite simple.

name
(required) The name of the public body.
(required) The name of the public agency.
email
(optional) If you give no email, users will not be able to make requests to this public body. You can fill in email addresses later through the admin.
(optional) If you give no email, users will not be able to make requests to this public agency. You can fill in email addresses later through the admin.
jurisdiction__slug
(required) Give the slug of the jurisdiction this public body belongs to.
(required) Give the slug of the jurisdiction this public agency belongs to.
other_names
(optional) Possible other, alternative names for the public body separated by commas.
(optional) Possible other, alternative names for the public agency separated by commas.
description
(optional) A text description of the public body.
(optional) A text description of the public agency.
tags
(optional) A comma-separated (possibly quoted) list of tags for this public body.
(optional) A comma-separated (possibly quoted) list of tags for this public agency.
Tags may already exist or not.
url
(optional) Website for this public body.
(optional) Website for this public agency.
parent__name
(optional) if this public body has a parent, give it's name here. The parent must be specified before in the CSV file.
(optional) if this public agency has a parent, give it's name here. The parent must be specified before in the CSV file.
classification
(optional) Give a classification (e.g. "ministry").
contact
(optional) Contact information apart from post address and email. E.g. phone or fax number. May contain line breaks.
address
(optional) Postal address of this public body.
(optional) Postal address of this public agency.
website_dump
(optional) Any further text that can be used to described this public body. This is used for search indexing and will not be displayed publicly.
(optional) Any further text that can be used to described this public agency. This is used for search indexing and will not be displayed publicly.
request_note
(optional) Display this text for this public body when making a request to it.
(optional) Display this text for this public agency when making a request to it.

If during import a public body with the same slug is found, it is skipped and not overwritten.
If during import a public agency with the same slug is found, it is skipped and not overwritten.

Importing through Admin
-----------------------

The admin interface that lists public bodies has an import form at the very bottom of the page. Give a HTTP or HTTPS URL of your CSV file and press the import button. The file will be downloaded and imported. Any errors will be shown to you.
The admin interface that lists public agencies has an import form at the very bottom of the page. Give a HTTP or HTTPS URL of your CSV file and press the import button. The file will be downloaded and imported. Any errors will be shown to you.


Importing via command line
Expand Down
6 changes: 3 additions & 3 deletions froide/account/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ class Meta:

ADDRESS_REQUIRED_HELP_TEXT = _(
"Your address will not be displayed "
"publicly and is only needed because a public body "
"publicly and is only needed because a public agency "
"will likely want to send you paper."
)

ADDRESS_HELP_TEXT = _(
"Your address will not be displayed "
"publicly and is only needed in case a public body "
"publicly and is only needed in case a public agency "
"needs to send you paper."
)

Expand Down Expand Up @@ -142,7 +142,7 @@ class NewUserBaseForm(AddressBaseForm):
label=_("Hide my name from public view"),
help_text=format_html(
_(
"If you check this, your name will still appear in requests to public bodies, but we will do our best to not display it publicly. However, we cannot guarantee your anonymity"
"If you check this, your name will still appear in requests to public agencies, but we will do our best to not display it publicly. However, we cannot guarantee your anonymity"
)
),
)
Expand Down
2 changes: 1 addition & 1 deletion froide/account/templates/account/confirmed.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2>{% trans "Your email address is now confirmed!" %}</h2>
Your request “<a href="{{ url }}">{{ title }}</a>” has been sent.
{% endblocktrans %}
</p>
<p>{% trans "We will send you an email when you receive a reply from the public body." %}</p>
<p>{% trans "We will send you an email when you receive a reply from the public agency." %}</p>
{% endif %}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion froide/account/templates/account/new.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1>{% trans "Please confirm your email address!" %}</h1>
{% if title %}
<p class="lead">
{% blocktrans with title=title %}
Your request “{{ title }}” will only be sent to the public body, when you confirm your email address.
Your request “{{ title }}” will only be sent to the public agency, when you confirm your email address.
{% endblocktrans %}
</p>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion froide/account/templates/account/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ <h4 class="text-center">{% translate "Most followed requests" %}</h4>
{% if top_publicbodies %}
<div class="col-12">
<div class="rounded-3 px-3 pt-3 pb-2 mb-3 bg-body-secondary">
<h4 class="text-center">{% translate "Top requested public bodies" %}</h4>
<h4 class="text-center">{% translate "Top requested public agencies" %}</h4>
<ol class="lead">
{% for pb in top_publicbodies %}
<li>
Expand Down
2 changes: 1 addition & 1 deletion froide/document/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class DocumentSearchView(BaseSearchView):
"getter": lambda x: str(x["object"].pk),
"query_param": "publicbody",
"label_getter": lambda x: x["object"].name,
"label": _("public bodies"),
"label": _("public agencies"),
},
"collections": {
"queryset": DocumentCollection.objects.filter(public=True),
Expand Down
2 changes: 1 addition & 1 deletion froide/foirequest/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ class MessageTagAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("name",)}
actions = ["export_csv"]

@admin.action(description=_("Export public body tag stats to CSV"))
@admin.action(description=_("Export public agency tag stats to CSV"))
def export_csv(self, request, queryset):
from froide.publicbody.models import PublicBody

Expand Down
4 changes: 2 additions & 2 deletions froide/foirequest/foi_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ def check_delivery_conditions(
return None, None

if publicbody:
# if email can be matched to public body, deliver to foirequest
# if email can be matched to public agency, deliver to foirequest
return foirequest, publicbody

if parsed_email.bounce_info.is_bounce:
# If public body cannot be found, but it's a bounce message, deliver
# If public agency cannot be found, but it's a bounce message, deliver
return foirequest, None

# No match and not bounce, raise DeferredMessageNeeded
Expand Down
14 changes: 7 additions & 7 deletions froide/foirequest/forms/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def get_message_sender_form(*args, **kwargs):

class MessagePublicBodySenderForm(forms.Form):
sender = forms.ModelChoiceField(
label=_("Sending Public Body"),
label=_("Sending Public Agency"),
queryset=PublicBody.objects.all(),
widget=PublicBodySelect,
)
Expand Down Expand Up @@ -197,7 +197,7 @@ def get_message_recipient_form(*args, **kwargs):

class MessagePublicBodyRecipientForm(forms.Form):
recipient = forms.ModelChoiceField(
label=_("Recipient Public Body"),
label=_("Recipient Public Agency"),
queryset=PublicBody.objects.all(),
widget=PublicBodySelect,
)
Expand Down Expand Up @@ -263,7 +263,7 @@ class SendMessageForm(AttachmentSaverMixin, AddressBaseForm, forms.Form):
label=_("Send physical address"),
widget=BootstrapCheckboxInput,
help_text=_(
"If the public body is asking for your post "
"If the public agency is asking for your post "
"address, check this and we will append the "
"address below."
),
Expand Down Expand Up @@ -574,7 +574,7 @@ def set_data_on_message(self, message):
# The problem we have when uploading postal messages is that they do not have a time, so we
# need to invent one. 12am is a good assumption, however if we already have messages on this
# date, we need to add it *after* all those messages
# Example: User sends a foi request on 2011-01-01 at 3pm, the public body is fast and sends
# Example: User sends a foi request on 2011-01-01 at 3pm, the public agency is fast and sends
# out the reply letter on the same day. If we would assume 12am as the letter time, we would
# place the postal reply earlier than the users message
possible_message_timestamps = [
Expand Down Expand Up @@ -623,7 +623,7 @@ def save(self):
class PostalBaseForm(MessageEditMixin, AttachmentSaverMixin, forms.Form):
scan_help_text = _("Uploaded scans can be PDF, JPG, PNG or GIF.")
publicbody = forms.ModelChoiceField(
label=_("Public body"),
label=_("Public agency"),
queryset=PublicBody.objects.all(),
widget=PublicBodySelect,
)
Expand Down Expand Up @@ -695,7 +695,7 @@ class PostalReplyForm(PostalBaseForm):
"files",
"not_publishable",
]
PUBLICBODY_LABEL = _("Sender public body")
PUBLICBODY_LABEL = _("Sender public agency")

sender = forms.CharField(
label=_("Sender name"),
Expand Down Expand Up @@ -743,7 +743,7 @@ def get_postal_message_form(*args, **kwargs):

class PostalMessageForm(PostalBaseForm):
FIELD_ORDER = ["publicbody", "recipient", "date", "subject", "text", "files"]
PUBLICBODY_LABEL = _("Receiving public body")
PUBLICBODY_LABEL = _("Receiving public agency")

recipient = forms.CharField(
label=_("Recipient Name"),
Expand Down
4 changes: 2 additions & 2 deletions froide/foirequest/forms/postal.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class PostalUploadForm(MessageEditMixin, JSONMixin, forms.Form):
)

publicbody = forms.ModelChoiceField(
label=_("Public body"),
label=_("Public agency"),
queryset=PublicBody.objects.all(),
required=True,
widget=PublicBodySelect,
Expand Down Expand Up @@ -168,7 +168,7 @@ class PostalEditForm(MessageEditMixin, JSONMixin, forms.Form):
)

publicbody = ModelChoiceField(
label=_("Public body"),
label=_("Public agency"),
queryset=PublicBody.objects.all(),
required=True,
widget=HiddenInput(),
Expand Down
2 changes: 1 addition & 1 deletion froide/foirequest/forms/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def __init__(self, *args, **kwargs):
widget=BootstrapSelect,
help_text=_(
"When you are (partially) denied access to information, "
"the Public Body should always state the reason."
"the Public Agency should always state the reason."
),
)

Expand Down
12 changes: 6 additions & 6 deletions froide/foirequest/forms/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ def clean(self):

class MakePublicBodySuggestionForm(forms.Form):
publicbody = forms.ModelChoiceField(
label=_("Public body"),
label=_("Public agency"),
queryset=None,
widget=PublicBodySelect,
)
reason = forms.CharField(
label=_("Please specify a reason why this is the right Public Body:"),
label=_("Please specify a reason why this is the right Public Agency:"),
widget=forms.TextInput(attrs={"size": "40", "placeholder": _("Reason")}),
required=False,
)
Expand Down Expand Up @@ -213,10 +213,10 @@ def clean_suggestion(self):

def clean(self):
if self.foirequest.public_body is not None:
raise forms.ValidationError(_("This request doesn't need a Public Body!"))
raise forms.ValidationError(_("This request doesn't need a Public Agency!"))

if not self.foirequest.needs_public_body():
raise forms.ValidationError(_("This request doesn't need a Public Body!"))
raise forms.ValidationError(_("This request doesn't need a Public Agency!"))
return self.cleaned_data

def save(self, user=None):
Expand Down Expand Up @@ -287,7 +287,7 @@ class FoiRequestStatusForm(forms.Form, JSONMixin):
localize=True,
widget=PriceInput,
help_text=_(
"Please specify what the Public Body charges for the information."
"Please specify what the Public Agency charges for the information."
),
)

Expand All @@ -305,7 +305,7 @@ def __init__(self, *args, **kwargs):
widget=BootstrapSelect,
help_text=_(
"When you are (partially) denied access to information, "
"the Public Body should always state the reason."
"the Public Agency should always state the reason."
),
)

Expand Down
Loading

0 comments on commit 1e8fabd

Please sign in to comment.