-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #600 from coders4help/release/v4.1.0
Release v4.1.0
- Loading branch information
Showing
78 changed files
with
1,699 additions
and
1,509 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}") |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.