Skip to content

Commit

Permalink
Merge branch 'main' into django-local-env
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis authored Nov 13, 2024
2 parents 91f6155 + 44c7722 commit c8e9d5f
Show file tree
Hide file tree
Showing 214 changed files with 2,731 additions and 2,909 deletions.
59 changes: 25 additions & 34 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# Contributor Covenant Code of Conduct

## Our Pledge
Expand All @@ -6,8 +7,8 @@ We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
Expand All @@ -22,17 +23,17 @@ community include:
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

Expand All @@ -52,25 +53,15 @@ decisions when appropriate.

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement
<!---
Edits made to the enforcement section to avoid explicitly putting contact
information, as it seems that people are copying and pasting the code of conduct
without reading it fully and realizing that there are contacts for other projects.
--->

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement - these being the
main project stakeholders or individuals specifically tasked with overseeing the
values described within this code. Contact details must be readily provided for
the latter party, and for the former if no community leader has been given the
specific responsibility to oversee community conduct.

Within source code, the contact for those responsible for community conduct can
be found in a corresponding COC_CONTACT file. All complaints will be reviewed and
reported to the community leaders responsible for enforcement via the contact
in the corresponding COC_CONTACT file. All complaints will be reviewed and
investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand All @@ -92,15 +83,15 @@ behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.
**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

Expand All @@ -116,27 +107,27 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.
**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
at [https://www.contributor-covenant.org/translations][translations].
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
113 changes: 113 additions & 0 deletions .github/workflows/check_dependency_updates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: check_dependency_updates

on:
schedule:
- cron: '0 0 15 */2 *'
workflow_dispatch:

jobs:
update_dependencies:
runs-on: ubuntu-latest
steps:
# MARK: Environments

- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Node Environment
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Yarn
uses: borales/actions-yarn@v5
with:
cmd: install
dir: "frontend"

# MARK: Dependency Updates

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'

- name: Update Backend Dependencies
working-directory: backend
run: |
python -m pip install --upgrade uv
uv venv
uv pip install -r requirements-dev.txt
pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
pip freeze > requirements-dev.txt
- name: Install npm-check-updates
run: npm install -g npm-check-updates

- name: Update Frontend Dependencies
working-directory: frontend
run: |
ncu -u
# MARK: Backend Tests

- name: Activate Virtual Environment
run: |
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Run Ruff Format - Formatting and Linting Check
run: ruff check ./backend || echo "Ruff check failed" >> error_log.txt

- name: Run mypy - Static Type Checking
if: always()
run: mypy ./backend --config-file ./backend/pyproject.toml || echo "mypy check failed" >> error_log.txt

- name: Run pytest - Unit Tests
if: always()
run: pytest ./backend -vv || echo "Backend tests failed." >> error_log.txt

# MARK: Frontend Tests

- name: Install Prettier
run: yarn add prettier

- name: Run Prettier - Formatting Check
working-directory: ./frontend
run: |
yarn prettier . --check --config ../.prettierrc --ignore-path ../.prettierignore || echo "Prettier check failed." >> error_log.txt
- name: Run Nuxt Type Check
if: always()
uses: borales/actions-yarn@v4
with:
cmd: nuxi typecheck || echo "Type check failed." >> error_log.txt
dir: "frontend"

- name: Run ESLint - Linting
if: always()
uses: borales/actions-yarn@v4
with:
cmd: eslint . || echo "ESLint check failed." >> error_log.txt
dir: "frontend"

# MARK: Errors and Issue

- name: Log Errors
if: failure()
run: |
if [[ -f error_log.txt ]]; then
cat error_log.txt
else
echo "No errors found during dependency update."
fi
- name: Create GitHub Issue
if: failure()
uses: peter-evans/create-issue-from-file@v4
with:
title: $(date +%Y-%m-%d) Dependency Update Errors
content-filepath: error_log.txt
labels: |
dependencies
help wanted
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ git remote add upstream https://github.com/activist-org/activist.git
4. Start your docker images with the following:

```bash
# --build only necessary with new dependencies or backend model changes
# --build only necessary with new dependencies or backend model changes.
docker compose --env-file .env.dev up --build

# And to stop the containers when you're done working:
Expand Down
30 changes: 8 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ The following are the current and planned technologies for [activist.org](https:

### Backend

- [Django](https://www.djangoproject.com) • [PostgreSQL](https://www.postgresql.org) (planned)
- [Django](https://www.djangoproject.com) • [PostgreSQL](https://www.postgresql.org)

### Deployment

Expand Down Expand Up @@ -406,30 +406,19 @@ We would like to thank all the great software that made activist's development p
- [OpenStreetMap](https://www.openstreetmap.org)
- [MapLibre](https://maplibre.org/)
### Our partners
### Our supporters
#### Our fiscal host Änderwerk
#### Licensed software providers
<details><summary>About Änderwerk</summary>
<p>
Änderwerk is a non-profit host organization for projects, initiatives and movements working towards a better future for people and the planet.
They take care of fiscal hosting, managing donations, budgets, accounting and the transformation of financial resources into useful tools.
The following organizations have supported activist with licenses to use their technology for free:
They enable initiatives and groups in their hub to concentrate on what they do best – effective community-led action, aligned with their values and goals.
We are happy to be a part of this community.
</p>
</details>
- [Weblate](https://weblate.org/)
- [GitBook](https://www.gitbook.com/)
- [Formbricks](https://formbricks.com/)
#### The Wikimedia UNLOCK Accelerator
<details><summary>About UNLOCK</summary>
<p>
These organizations have supported activist via the 2022 edition of the Wikimedia UNLOCK accelerator. UNLOCK supports open-source software projects and non-technical projects under free licenses. UNLOCK Accelerator is committed to promoting solutions that make the world's knowledge more diverse, more accessible and inclusive for everyone.
These organizations have supported activist via the 2022 edition of the Wikimedia UNLOCK accelerator. UNLOCK supported open-source software projects and non-technical projects under free licenses. UNLOCK Accelerator was committed to promoting solutions that make the world's knowledge more diverse, more accessible and inclusive for everyone.

<div align="center">
<br>
Expand All @@ -442,9 +431,6 @@ These organizations have supported activist via the 2022 edition of the Wikimedi
<br>
</div>

</p>
</details>

# Disclosure

activist is not directly affiliated with any corporation, political party or government.
4 changes: 4 additions & 0 deletions backend/authentication/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ class Meta:
# MARK: Methods


class DeleteUserResponseSerializer(serializers.Serializer[UserModel]):
message = serializers.CharField(max_length=200)


class SignupSerializer(serializers.ModelSerializer[UserModel]):
password_confirmed = serializers.CharField(write_only=True)

Expand Down
2 changes: 2 additions & 0 deletions backend/authentication/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
UserTopic,
)
from .serializers import (
DeleteUserResponseSerializer,
LoginSerializer,
PasswordResetSerializer,
SignupSerializer,
Expand Down Expand Up @@ -239,6 +240,7 @@ def post(self, request: Request) -> Response:
class DeleteUserView(APIView):
queryset = UserModel.objects.all()
permission_classes = (IsAuthenticated,)
serializer_class = DeleteUserResponseSerializer

def delete(self, request: Request, pk: UUID | str) -> Response:
user = UserModel.objects.get(pk=pk)
Expand Down
Loading

0 comments on commit c8e9d5f

Please sign in to comment.