Skip to content

Commit

Permalink
Merge branch 'main' into docker
Browse files Browse the repository at this point in the history
  • Loading branch information
miteshashar committed Oct 24, 2023
2 parents f3ac8b0 + 689b717 commit 7ba0838
Show file tree
Hide file tree
Showing 433 changed files with 16,806 additions and 20,961 deletions.
39 changes: 37 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,42 @@
* text=auto eol=lf

*.py text eol=lf
*.gif binary
*.ico binary
*.jpg binary
*.mo binary
*.png binary
*.webp binary

.coveragerc text eol=lf
.dockerignore text eol=lf
.flaskenv text eol=lf
.gitattributes text eol=lf
.gitignore text eol=lf
Dockerfile text eol=lf
HOSTALIASES text eol=lf
Makefile text eol=lf
*.cfg text eol=lf
*.css text eol=lf
*.Dockerfile text eol=lf
*.env text eol=lf
*.feature text eol=lf
*.html text eol=lf
*.in text eol=lf
*.ini text eol=lf
*.jinja2 text eol=lf
*.js text eol=lf
*.json text eol=lf
*.md text eol=lf
*.po text eol=lf
*.pot text eol=lf
*.py text eol=lf
*.rb text eol=lf
*.rst text eol=lf
*.sample text eol=lf
*.scss text eol=lf
*.jinja2 text eol=lf
*.sh text eol=lf
*.svg text eol=lf
*.toml text eol=lf
*.txt text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
8 changes: 2 additions & 6 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest] # TODO: Figure out macos-latest and Docker
python-version: ['3.7', '3.11']
python-version: ['3.11', '3.12']

services:
redis:
Expand Down Expand Up @@ -77,15 +77,11 @@ jobs:
path: ${{ env.pythonLocation }}
key: ${{ matrix.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/base.txt') }}-${{ hashFiles('requirements.txt/test.txt') }}
- name: Install Python dependencies
if: ${{ matrix.python-version != '3.7' }}
run: make install-python-test
- name: Install Python dependencies (3.7)
if: ${{ matrix.python-version == '3.7' }}
run: make install-python-test-37
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: latest
node-version: 20
cache: npm
- name: Cache node modules
uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/telegram.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@ jobs:
format: html
disable_web_page_preview: true
message: |
<b>${{ github.event_name }}</b> by ${{ needs.tguser.outputs.tguser }} (${{ github.actor }}) in ${{ github.repository }}: ${{ github.event.head_commit.message }} ${{ github.event.compare }}
<b>${{ github.event_name }}</b> by ${{ needs.tguser.outputs.tguser }} (${{ github.actor }}) in ${{ github.repository }}/${{ github.ref_name }}: ${{ github.event.head_commit.message }} ${{ github.event.compare }}
38 changes: 22 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# See https://pre-commit.com/hooks.html for more hooks
default_stages: [commit]
# Enable this to enforce a common Python version:
# default_language_version:
# python: python3.9
default_language_version:
python: python3.11
ci:
skip: [
'pip-audit',
Expand All @@ -14,7 +14,7 @@ ci:
]
repos:
- repo: https://github.com/pre-commit-ci/pre-commit-ci-config
rev: v1.5.1
rev: v1.6.1
hooks:
- id: check-pre-commit-ci-config
- repo: https://github.com/peterdemin/pip-compile-multi
Expand All @@ -23,7 +23,7 @@ repos:
- id: pip-compile-multi-verify
files: ^requirements/.*\.(in|txt)$
- repo: https://github.com/pypa/pip-audit
rev: v2.6.0
rev: v2.6.1
hooks:
- id: pip-audit
args: [
Expand All @@ -46,8 +46,13 @@ repos:
'PYSEC-2023-101', # https://github.com/pytest-dev/pytest-selenium/issues/310
]
files: ^requirements/.*\.txt$
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: ['--keep-runtime-typing', '--py310-plus']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.280
rev: v0.1.0
hooks:
- id: ruff
args: ['--fix', '--exit-non-zero-on-fix']
Expand All @@ -64,12 +69,6 @@ repos:
'--remove-unused-variables',
'--remove-duplicate-keys',
]
- repo: https://github.com/asottile/pyupgrade
rev: v3.9.0
hooks:
- id: pyupgrade
args:
['--keep-runtime-typing', '--py3-plus', '--py36-plus', '--py37-plus']
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
Expand Down Expand Up @@ -99,7 +98,7 @@ repos:
additional_dependencies:
- tomli
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 23.10.0
hooks:
- id: black
# Mypy is temporarily disabled until the SQLAlchemy 2.0 migration is complete
Expand All @@ -123,12 +122,12 @@ repos:
# - types-requests
# - typing-extensions
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies: *flake8deps
- repo: https://github.com/PyCQA/pylint
rev: v3.0.0a6
rev: v3.0.1
hooks:
- id: pylint
args: [
Expand All @@ -148,7 +147,7 @@ repos:
additional_dependencies:
- 'bandit[toml]'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-ast
Expand Down Expand Up @@ -181,8 +180,15 @@ repos:
files: requirements/.*\.in
- id: trailing-whitespace
args: ['--markdown-linebreak-ext=md']
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: forbid-tabs
- id: remove-tabs
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0
rev: v3.0.3
hooks:
- id: prettier
args:
Expand Down
4 changes: 2 additions & 2 deletions .testenv
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ FLASK_SITE_SUPPORT_EMAIL='[email protected]'
FLASK_SITE_SUPPORT_PHONE='+917676332020'
FLASK_MAIL_DEFAULT_SENDER="Funnel <[email protected]>"
DB_HOST=localhost
FLASK_SQLALCHEMY_DATABASE_URI='postgresql+psycopg://${DB_HOST}/funnel_testing'
FLASK_SQLALCHEMY_BINDS__geoname='postgresql+psycopg://${DB_HOST}/geoname_testing'
FLASK_SQLALCHEMY_DATABASE_URI=postgresql+psycopg://${DB_HOST}/funnel_testing
FLASK_SQLALCHEMY_BINDS__geoname=postgresql+psycopg://${DB_HOST}/geoname_testing
FLASK_TIMEZONE='Asia/Kolkata'
FLASK_BOXOFFICE_SERVER='http://boxoffice:6500/api/1/'
FLASK_IMGEE_HOST='http://imgee.test:4500'
Expand Down
51 changes: 0 additions & 51 deletions .travis.yml

This file was deleted.

16 changes: 1 addition & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
all:
@echo "You must have an active Python virtualenv (3.7+) before using any of these."
@echo "You must have an active Python virtualenv (3.11+) before using any of these."
@echo
@echo "For production deployment:"
@echo " make install # For first time setup and after dependency upgrades"
Expand Down Expand Up @@ -75,11 +75,6 @@ deps-python: deps-editable
pip install --upgrade pip pip-tools pip-compile-multi
pip-compile-multi --backtracking --use-cache

deps-python-37: deps-editable
# pip 23.2 breaks pip-tools 6, but pip-tools 7 doesn't support Python 3.7
pip install --upgrade 'pip<23.2' pip-tools pip-compile-multi
pip-compile-multi --backtracking --use-cache -o py37.txt

deps-python-noup:
pip-compile-multi --backtracking --use-cache --no-upgrade

Expand Down Expand Up @@ -123,15 +118,6 @@ install-python-test: install-python-pip deps-editable
install-python: install-python-pip deps-editable
pip install --use-pep517 -r requirements/base.txt

install-python-dev-37: install-python-pip deps-editable
pip install --use-pep517 -r requirements/dev.py37.txt

install-python-test-37: install-python-pip deps-editable
pip install --use-pep517 -r requirements/test.py37.txt

install-python-37: install-python-pip deps-editable
pip install --use-pep517 -r requirements/base.py37.txt

install-dev: deps-editable install-python-dev install-npm assets

install-test: deps-editable install-python-test install-npm assets
Expand Down
8 changes: 3 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ Hasgeek

Code for Hasgeek.com at https://hasgeek.com/

Copyright © 2010-2022 by Hasgeek
Copyright © 2010-2023 by Hasgeek

This code is open source under the AGPL v3 license (see LICENSE.txt). We welcome your examination of our code to:

* Establish trust and transparency on how it works, and
* Allow contributions

To establish our intent, we use the AGPL v3 license, which requires you to release all your modifications to the public under the same license. You may not make a proprietary fork. To have your contributions merged back into the master repository, you must agree to assign copyright to Hasgeek, and must assert that you have the right to make this assignment. (We realise this sucks, so if you have a better idea, we’d like to hear it.)
To establish our intent, we use the AGPL v3 license, which requires you to release your modifications to the public under the same license. You may not make a proprietary fork. To have your contributions merged into the main repository, you must agree to assign copyright to Hasgeek, and must assert that you have the right to make this assignment. You will be asked to sign a Contributor License Agreement when you make a Pull Request.

Our workflow assumes this code is for use on a single production website. Using this to operate your own website is not recommended. Brand names and visual characteristics are not covered under the source code license.
Our workflow assumes this code is for use on a single production website. Using this to operate your own website is not recommended. Brand names, logos and visual characteristics are not covered under the source code license.

We aim to have our source code useful to the larger community. Several key components are delegated to the Coaster library, available under the BSD license. Requests for liberal licensing of other components are also welcome. Please file an issue ticket.

This repository uses Travis CI for test automation and has dependencies scanned by PyUp.io.
6 changes: 4 additions & 2 deletions funnel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@
# API it borrows from the Flask-Login extension
app.login_manager = views.login_session.LoginManager() # type: ignore[attr-defined]

app.config['FLATPAGES_MARKDOWN_EXTENSIONS'] = ['markdown.extensions.nl2br']
app.config['FLATPAGES_EXTENSION'] = '.md'
# These extensions are only required in the main app
migrate = Migrate(app, db)
pages.init_app(app)
Expand Down Expand Up @@ -174,15 +176,15 @@
filters='rjsmin',
),
)
app.assets.register(
app.assets.register( # type: ignore[attr-defined]
'css_fullcalendar',
Bundle(
assets.require('jquery.fullcalendar.css', 'spectrum.css'),
output='css/fullcalendar.packed.css',
filters='cssmin',
),
)
app.assets.register(
app.assets.register( # type: ignore[attr-defined]
'js_schedules',
Bundle(
assets.require('schedules.js'),
Expand Down
20 changes: 11 additions & 9 deletions funnel/assets/js/membership.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ const Membership = {
}) {
Vue.use(VS2);

const memberUI = Vue.component('member', {
const memberUI = Vue.component('membership', {
template: memberTemplate,
props: ['member'],
props: ['membership'],
methods: {
rolesCount(member) {
rolesCount(membership) {
let count = 0;
if (member.is_editor) count += 1;
if (member.is_promoter) count += 1;
if (member.is_usher) count += 1;
if (membership.is_editor) count += 1;
if (membership.is_promoter) count += 1;
if (membership.is_usher) count += 1;
return count - 1;
},
getInitials: Utils.getInitials,
Expand Down Expand Up @@ -114,9 +114,11 @@ const Membership = {
},
onChange() {
if (this.search) {
this.members.filter((member) => {
member.hide =
member.user.fullname
this.members.filter((membership) => {
/* FIXME: This is using fullname to identify a member,
it should use an id */
membership.hide =
membership.member.fullname
.toLowerCase()
.indexOf(this.search.toLowerCase()) === -1;
return true;
Expand Down
2 changes: 1 addition & 1 deletion funnel/assets/js/notification_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $(() => {

$('.js-toggle-switch').on('change', function toggleNotifications() {
const checkbox = $(this);
const transport = $(this).attr('id');
const transport = $(this).attr('data-transport');
const currentState = this.checked;
const previousState = !currentState;
const form = $(this).parents('.js-autosubmit-form')[0];
Expand Down
Loading

0 comments on commit 7ba0838

Please sign in to comment.