Skip to content

Commit

Permalink
Merge pull request #600 from coders4help/release/v4.1.0
Browse files Browse the repository at this point in the history
Release v4.1.0
  • Loading branch information
pitpalme authored Apr 13, 2022
2 parents de469b5 + 114b8f9 commit 5217091
Show file tree
Hide file tree
Showing 78 changed files with 1,699 additions and 1,509 deletions.
2 changes: 2 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
DJANGO_SETTINGS_MODULE=volunteer_planner.settings.production

CACHE_BACKEND=django.core.cache.backends.locmem.LocMemCache

DATABASE_ENGINE=django.db.backends.postgresql_psycopg2
DATABASE_NAME=volunteer_planner
DATABASE_USER=vp
Expand Down
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ per-file-ignores =
volunteer_planner/settings/*.py: F401, F403, F405,

max-line-length = 88
exclude = .*, __pycache__
30 changes: 30 additions & 0 deletions .git-commit-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Title: Summary, imperative, start upper case, don't end with a period
# No more than 50 chars. #### 50 chars is here: #

# Remember blank line between title and body.

# Body: Explain *what* and *why* (not *how*). Include task ID (Jira issue).
# Wrap at 72 chars. ################################## which is here: #


# At the end: Include Co-authored-by for all contributors.
# Include at least one empty line before it. Format:
# Co-authored-by: name <user@users.noreply.github.com>
#
# How to Write a Git Commit Message:
# https://chris.beams.io/posts/git-commit/
#
#
# 1. Separate subject from body with a blank line
# 2. Limit the subject line to 50 characters
# 3. Capitalize the subject line
# 4. Do not end the subject line with a period
# 5. Use the imperative mood in the subject line
# 6. Wrap the body at 72 characters
# 7. Use the body to explain what and why vs. how
#
# Template reference:
# https://gist.github.com/lisawolderiksen/a7b99d94c92c6671181611be1641c733
#
# To activate this template:
# $ git config --local commit.template .git-commit-template
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ develop, main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]
schedule:
- cron: '40 5 * * 3'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
# language: [ 'javascript', 'python' ]
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
#- name: Autobuild
# uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
71 changes: 65 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,78 @@ All notable changes to this project will be documented in this file.

### Removed

## [3.1.1] - 2017-02-06
## [4.1.0] - 2022-04-13
Bugfix and improvements release with little (visibly) new things

### Added
- Integrate django-post-office
- Add sentry integration
- Create codeql-analysis.yml
- Add commonly requested static files

### Changed
- Bump django-ckeditor from 6.2.0 to 6.3.0 in /requirements
- Bump django from 4.0.3 to 4.0.4 in /requirements
- Bump django-ckeditor from 6.3.0 to 6.3.2 in /requirements
- Bump sentry-sdk from 1.5.8 to 1.5.9 in /requirements by

### Fixed
- Hotfix/562 fix admin ordering by task and workplace
- Make admin timezone aware for shift/-templates
- Fix #575, broken icon in schedule template admin
- Fixes #570: regions nav bar items not sorted well
- Fixes #547: jQuery selector expected
- Correct shift details user view
- Fix URL redirection from remote source
- Fix URL date parsing
- Shift notification messages from managers *only*

## [4.0.0] - 2022-04-03
Revival. Volunteer Planner is back.

### Added
*added french translation
*added portuguese translation (not fully translated yet)
*added turkish translation (not fully translated yet)
- privacy policy acception during registration in #437
- czech translation #406
- priority attribute for task and workplace, can be used to control listing order #476
- black and flake8 #518 #519
- GitHub templates for issues and feature requests
- Allow login in with email address as username #522

### Changed
*updated all existing translations (massive improvements in translation)
- lift Django version (+ libraries and frameworks) #488
- Python3 #487
- PostgreSQL is now default DBMS
- automatically assign permissions, when promoted as manager #425
- on landing page list only facilities with open shifts #454
- update translations
- reduce number of SQL queries for facility, shift date and news listing #513
- restrict username variations #520

### Fixed
- fix #398: deleting a non-past shift failed hard when trying to gather information about email about to be sent
- check task and workplace match facility when creating shifts #433
- better filter for organization and facility membership / manager permission
- remove user from shift on account deletion #516
- Sending e-mail on membership approval was broken #533
- Make membership unique per user and facility / organization #524

### Removed
- short description removed from organization and facility #442
- shiftmailer removed #452
- user e-mail address removed from user account admin (so managers see less data uncontrolled) #490
- user e-mail address removed from admin shift list #505
- google_tools app removed #510

## [3.1.1] - 2017-02-06
### Added
- added french translation
- added portuguese translation (not fully translated yet)
- added turkish translation (not fully translated yet)

### Changed
- updated all existing translations (massive improvements in translation)

### Fixed
- fix #398: deleting a non-past shift failed hard when trying to gather information about email about to be sent

## [3.1.0] - 2016-10-10
### Added
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ There are some feature requests to be implemented in the future.
The software currently needs a centralized administration of the shifts, but it is one of the main goals of the current
development to empower organizations to schedule shifts for their facilities on their own.

If you are interested to contribute, join the [developer Slack channel](https://join.slack.com/t/coders4help/shared_invite/zt-1520v8cef-DytzxhO~ubmTrX0CdVcpxQ) or create a feature or fix pull request directly.
If you are interested to contribute, you're invited to send an
[email](mailto:kontakt@volunteer-planner.org?subject=Slack%20Invitation%20Request)
to join the developer Slack channel or create a feature or fix pull request directly.

## System context
**User**: The volunteers and administrators just need a (modern) web browser to use the volunteer-planner application.
Expand Down
8 changes: 4 additions & 4 deletions accounts/templates/shift_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

{% for shifts in shifts_today %}
<li class="list-group-item list-group-item-info">{{ shifts.shift }}
<a href="{{shifts.shift.get_absolute_url}}/direct/" class="btn btn-default">{% translate 'Show this work shift' %}</a>
<a href="{{shifts.shift.get_absolute_url}}" class="btn btn-default">{% translate 'Show this work shift' %}</a>
</li>
{% endfor %}
</ul>
Expand All @@ -30,7 +30,7 @@

{% for shifts in shifts_tomorrow %}
<li class="list-group-item list-group-item-info">{{ shifts.shift }}
<a href="{{shifts.shift.get_absolute_url}}/direct/" class="btn btn-default">{% translate 'Show this work shift' %}</a>
<a href="{{shifts.shift.get_absolute_url}}" class="btn btn-default">{% translate 'Show this work shift' %}</a>
</li>
{% endfor %}
</ul>
Expand All @@ -44,7 +44,7 @@

{% for shifts in shifts_day_after_tomorrow %}
<li class="list-group-item list-group-item-info">{{ shifts.shift }}
<a href="{{shifts.shift.get_absolute_url}}/direct/" class="btn btn-default">{% translate 'Show this work shift' %}</a>
<a href="{{shifts.shift.get_absolute_url}}" class="btn btn-default">{% translate 'Show this work shift' %}</a>
</li>
{% endfor %}
</ul>
Expand All @@ -58,7 +58,7 @@

{% for shifts in shifts_further_future %}
<li class="list-group-item list-group-item-info">{{ shifts.shift }}
<a href="{{shifts.shift.get_absolute_url}}/direct/" class="btn btn-default">{% translate 'Show this work shift' %}</a>
<a href="{{shifts.shift.get_absolute_url}}" class="btn btn-default">{% translate 'Show this work shift' %}</a>
</li>

{% endfor %}
Expand Down
44 changes: 0 additions & 44 deletions common/conf_loader.py

This file was deleted.

47 changes: 47 additions & 0 deletions common/email_backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import logging
import os
import uuid

from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.mail.backends.base import BaseEmailBackend

logger = logging.getLogger(__name__)


class FileEmailBackend(BaseEmailBackend):
def __init__(self, *args, file_path=None, **kwargs):
# This __init__ is the same as in
# django.core.mail.backends.filebased.EmailBackend.__init__
if file_path is not None:
self.file_path = file_path
else:
self.file_path = getattr(settings, "EMAIL_FILE_PATH", None)
self.file_path = os.path.abspath(self.file_path)
try:
os.makedirs(self.file_path, exist_ok=True)
except FileExistsError:
raise ImproperlyConfigured(
"Path for saving email messages exists, but is not a directory: %s"
% self.file_path
)
except OSError as err:
raise ImproperlyConfigured(
"Could not create directory for saving email messages: %s (%s)"
% (self.file_path, err)
)
# Make sure that self.file_path is writable.
if not os.access(self.file_path, os.W_OK):
raise ImproperlyConfigured(
"Could not write to directory: %s" % self.file_path
)
super().__init__(*args, **kwargs)

def send_messages(self, email_messages):
for msg in email_messages:
message = msg.message()
msgid = str(message.get("Message-ID", uuid.uuid4())).strip("<>")
path = os.path.join(self.file_path, f"{msgid}.eml")
with open(path, "w") as f:
f.write(message.as_string())
logger.info(f"Saved email at {path}")
3 changes: 0 additions & 3 deletions common/models.py

This file was deleted.

3 changes: 0 additions & 3 deletions common/views.py

This file was deleted.

7 changes: 3 additions & 4 deletions content/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.contrib.flatpages.models import FlatPage
from django.contrib.flatpages.views import render_flatpage
from django.contrib.sites.shortcuts import get_current_site
from django.http import Http404, HttpResponsePermanentRedirect
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.views.decorators.csrf import csrf_protect

Expand Down Expand Up @@ -33,15 +33,14 @@ def translated_flatpage(request, url):
`flatpages.flatpages` object
"""
if not url.startswith("/"):
url = "/" + url
url = f"/{url}"
site_id = get_current_site(request).id
try:
f = get_object_or_404(FlatPage, url=url, sites=site_id)
except Http404:
if not url.endswith("/") and settings.APPEND_SLASH:
url += "/"
url = f"{url}/"
f = get_object_or_404(FlatPage, url=url, sites=site_id)
return HttpResponsePermanentRedirect("%s/" % request.path)
else:
raise
return render_translated_flatpage(request, f)
Expand Down
Loading

0 comments on commit 5217091

Please sign in to comment.