Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump certifi from 2022.6.15 to 2022.12.7 #103

Open
wants to merge 480 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
480 commits
Select commit Hold shift + click to select a range
9d9d713
Implementation of a amara api lock to avoid parallel requests
percidae Jan 8, 2021
0b39555
fixed some whitespace
percidae Jan 8, 2021
652be5e
Additional fields for amara links to later automate this part
percidae Jan 8, 2021
cfd5be3
Fix initial data set for updated models
mmarx Oct 15, 2016
d1517b2
Update test fixture & requirements
mmarx Nov 20, 2019
9b879a7
Drop unneeded import
mmarx Jan 9, 2021
67e729e
Bump django to 2.2
mmarx Jan 9, 2021
b638bbb
Update urlpatterns
mmarx May 15, 2016
900cd13
Fix foreign keys
mmarx May 15, 2016
dc7274d
Add session authentication middleware
mmarx May 15, 2016
6be50f5
Fix URL namespace for django-account
mmarx May 16, 2016
5d769b8
Move templates to APP_DIR, migrate to TEMPLATES
mmarx May 16, 2016
294b164
Add a first test case
mmarx May 16, 2016
82ab6a2
Fix event view
mmarx May 16, 2016
08c8855
Fix timezone for Event_Days
mmarx May 16, 2016
d57c28d
Add tests for views.event
mmarx May 16, 2016
52c0910
Add tests for progress bars
mmarx May 16, 2016
c9749ce
Add more test cases
mmarx May 17, 2016
e11dafe
Use reverse() in tests, add more tests, clean urls
mmarx May 17, 2016
4cb9b01
Fix timezone warning
mmarx May 17, 2016
ec3cac8
Add tests for talks with subtitles
mmarx May 17, 2016
05552ed
Add travis-ci support
mmarx May 17, 2016
bed5049
Fix redirects
mmarx May 17, 2016
e92b047
Add context processors
mmarx May 17, 2016
5b6d008
Fix .travis.yml
mmarx May 17, 2016
d5d5e02
Update README
mmarx May 17, 2016
49e5cf6
Add tests for subtitle update
mmarx May 18, 2016
5719177
Extend some tests
mmarx May 19, 2016
a3d0fb9
Add even more tests for updateSubtitle
mmarx May 22, 2016
133ee40
WIP: Start moving over to factoryboy
mmarx Oct 15, 2016
adba589
Move remaining templates
mmarx Jan 4, 2017
f50c641
Fix tests
mmarx Jan 4, 2017
48e5cb9
Fix use of select_related in scripts
mmarx Jan 4, 2017
576ed08
Move new templates
mmarx Jan 2, 2019
41b56cf
Fix config parsing
mmarx Jan 2, 2019
1325c32
Bump django, drop django-account, fix urls
mmarx Jan 2, 2019
0c188d7
Fix tests with django 2.1
mmarx Jan 2, 2019
9c98d03
Bump python & django versions for travis
mmarx Jan 2, 2019
79a7fc0
Test more python versions
mmarx Jan 2, 2019
0caf5db
Bump build environment
mmarx Jan 2, 2019
750fed8
Add more factories
mmarx Jan 6, 2019
0b31d51
Use correct version of the update_subtitles_via_amara_import script
mmarx Nov 20, 2019
d870bf2
Fix tests on django-2.2
mmarx Jan 10, 2021
46f848d
Update models and migrations for time zone awareness
mmarx Jan 10, 2021
0efa146
Use shorter content in Fixture factories
mmarx Jan 10, 2021
497216a
Update static template plugin loading
mmarx Jan 10, 2021
79527b4
Update test fixture
mmarx Jan 16, 2021
5367f30
Fix static URLs in DEBUG mode
mmarx Jan 16, 2021
274c8e3
Add transformation tests
mmarx Jan 16, 2021
adbd331
Add more verbose logging in DEBUG
mmarx Jan 16, 2021
a5249d4
Shorten building names in test fixtures
mmarx Jan 16, 2021
5799ea7
Rename test fixtures
mmarx Jan 16, 2021
ebf9b94
Fix sbv-alignment test cases
mmarx Jan 16, 2021
3d6acb5
Add more test cases
mmarx Jan 16, 2021
654238f
Add test case for pad-to-timing transformation
mmarx Jan 16, 2021
d7ba3a9
Fix test autodiscovery
mmarx Jan 16, 2021
ff81d60
Fix obsolete import
mmarx Jan 16, 2021
d1d76ee
Remove broken autorolead
mmarx Jan 23, 2021
3f3a034
Fix correct import for sleep()
mmarx Jan 23, 2021
edfbe7e
Fix timezone handling in alert script
mmarx Jan 23, 2021
d79b63b
Bump dependencies
mmarx Jan 23, 2021
ea3544b
Init github actions
ThoreKr Jan 23, 2021
b605201
New test badge
ThoreKr Jan 23, 2021
a383d80
Merge pull request #75 from ThoreKr/gh-action
mmarx Jan 23, 2021
dfbe498
Provide (invalid) default credentials
mmarx Jan 23, 2021
e30d292
Allow dev as host
mmarx Jan 23, 2021
5f22f3b
Extended the length of the frab_id_talk field for longer names
percidae Jan 23, 2021
af071bb
Update static files to new django version
mmarx Jan 23, 2021
a74de66
Fix syntax errors in templates
mmarx Jan 23, 2021
0225a1e
The 'back' button now only shows in talks which have an event which i…
percidae Jan 23, 2021
7f7aba8
Some additions to the admin interface
percidae Jan 24, 2021
92c7e34
Changed the admin view of talk to see more fields
percidae Jan 24, 2021
ebd8cb2
Changed the criteria for which date als last changed to show on each …
percidae Jan 24, 2021
1ce39c3
Fixed broken otranscribe link
percidae Jan 25, 2021
87991ac
Improved showing of the video links and the 'or' if one link is not a…
percidae Jan 25, 2021
65049ab
Added *.refresh_from_db() to avoid overwriting any changes which happ…
percidae Jan 26, 2021
e47054c
Added *.refresh_from_db() to avoid overwriting any changes which happ…
percidae Jan 26, 2021
7ab61e0
Added *.refresh_from_db() to avoid overwriting any changes which happ…
percidae Jan 26, 2021
e0140f0
Bugfix, missing import added for the function to create the amara key
percidae Jan 26, 2021
479d592
Fixed some spelling mistakes
percidae Jan 26, 2021
baba469
Added *.refresh_from_db() to avoid overwriting any changes which happ…
percidae Jan 26, 2021
2062d76
The overview of all talks of an event now also shows the track of the…
percidae Jan 29, 2021
a1ac3a6
Added more searchable fields in django admin for Talk and Subtitle
percidae Feb 17, 2021
69ca79e
Added several filter to the Talk Admin page
percidae Feb 17, 2021
09aef80
Added the status 'released_as_draft' and changed the filename accordi…
percidae Feb 19, 2021
21aaea2
Return the transcript version of a subtitle with or without linebreaks
percidae Feb 19, 2021
05e00cb
Subtitles set to quality control also set the release drafts flag
percidae Feb 19, 2021
8406793
Added functionality and flags to release and remove draft subtitle fi…
percidae Feb 19, 2021
c7085c2
Extended the relasing and removing cronjob to also release and remove…
percidae Feb 19, 2021
9bdcfb9
Changed the filename for the drafts to the real ones
percidae Feb 19, 2021
3bcf470
Minor changes to the text displayed in the draft subtitles
percidae Feb 19, 2021
5c8b1f7
Bug fix forgotten db query to get the right subtitles which need a dr…
percidae Feb 20, 2021
1519bf9
Changed the srt filename creation from manual to from the class function
percidae Feb 20, 2021
a8f1bad
Added a 'DRAFT_' prefix to every srt filename
percidae Feb 20, 2021
aad9811
Made sure to create an email even though only drafts have changed
percidae Feb 20, 2021
677614f
The talk page now also shows the links to the draft
percidae Feb 20, 2021
ef88751
Improved the diclaimer text in draft subtitles
percidae Feb 20, 2021
46efa5e
Some changes to the view for the media export to improve compatibilit…
percidae Feb 20, 2021
c257b13
Changed order_by to 'touched' for the media CSV export
percidae Feb 21, 2021
5aafd0b
Talk page now also shows the slug of the talk and the link to media
percidae Feb 21, 2021
529d5f8
Download links are visible for the selfnet mirror and the AGDSN mirror
percidae Feb 21, 2021
bd068d9
Added some anchors and more links directly to amara in the clicked la…
percidae Feb 21, 2021
4fdcdbd
Minor fix, better readability for the CSV function
percidae Feb 21, 2021
531300b
Minor syntax error bugfix
percidae Feb 24, 2021
21445da
Improved the display of the last changed timestamp for a subtitle
percidae Feb 24, 2021
9e74f66
Improved the display of the last changed timestamp for a subtitle in …
percidae Feb 24, 2021
5eb9c05
Bugfix, flags only work if they are not only set but also saved
percidae Feb 25, 2021
af2df78
Added some witing time for subtitles download to not run into errors
percidae Feb 25, 2021
258c6e8
Amara API address update
percidae Feb 25, 2021
c97fd02
Change API url to most up to date address
percidae Mar 1, 2021
267f2ed
Removed some sleeps waiting for the amara api
percidae Mar 2, 2021
5a798ec
Updated amara address and added some more usefull urls for transcript…
percidae Mar 6, 2021
59bc045
Fixed some tabs and spaces
percidae Mar 6, 2021
e02b59c
First draft of a dashboard
percidae Mar 6, 2021
dddf320
Added new url for the dashbaord
percidae Mar 6, 2021
b2ed330
Fixed a bug for the talks which need a c3s yt key
percidae Mar 6, 2021
f7e314e
Bugfix, wrong variable
percidae Mar 6, 2021
aa08144
Added some more visible data to decide what kind of a transcript a ta…
percidae Mar 6, 2021
7f3be45
More dashboard updates
percidae Mar 7, 2021
1574cf6
More dashboard updates
percidae Mar 7, 2021
19be673
More dashboard updates
percidae Mar 7, 2021
78fe7fc
More dashboard updates
percidae Mar 7, 2021
0a686f4
More dashboard updates
percidae Mar 9, 2021
47e5ea3
More dashboard updates
percidae Mar 9, 2021
a54767a
Added a extra website for talks which are not (yet) in the database
percidae Mar 11, 2021
aac8e4d
Added a link to the media api for talk information to the talk unavai…
percidae Mar 11, 2021
045cb43
Some improvements to the admin interface
percidae Mar 13, 2021
1ac521c
Renamed 'blacklisted' to 'unlisted'.
percidae Mar 13, 2021
eab1e39
Added links for admin and the dashboard for authenticated users.
percidae Mar 13, 2021
4861300
Implemented a 'Random Talks' Event to display talks where not the who…
percidae Mar 13, 2021
5445fd2
Added data to show for events with incomplete data
percidae Mar 13, 2021
9a7d882
More information on the dashboard
percidae Mar 13, 2021
a44c11f
Added direct address to the translations menu on youtube
percidae Apr 2, 2021
5660d3e
Changed update interval to a DurationField and changed amara update i…
percidae Apr 2, 2021
1d9cd4f
Updated default values of the amara update interval
percidae Apr 2, 2021
a4e681b
A bit more adapted to the pretalx format
percidae Apr 2, 2021
fd694cb
Changed max_length of the event acronym to 50 characters
percidae Apr 2, 2021
b056700
Changed default values of the amara_update_interval
percidae Apr 2, 2021
b765b6e
Changed default values of the amara_update_interval
percidae Apr 2, 2021
27c712d
Changed max_length of the hashtag in even to 50
percidae Apr 2, 2021
8e0b88e
Enabled search for the Speaker field in admin
percidae Apr 3, 2021
f1e7079
Updated default values for the amara_update_interval
percidae Apr 7, 2021
a9b8a7c
Updated links in the footer which still contained the very old domain
percidae Apr 7, 2021
31cc254
More details in admin e.g. the average wpm and spm
percidae May 12, 2021
86310ed
Added the IRC channel to the talk not found page since the rocket cha…
percidae Jun 6, 2021
22cf4f6
Spelling mistakes fixed
percidae Jun 6, 2021
c9e474c
More characters for 'schedule_version' due to bigger version names fo…
percidae Dec 26, 2021
a884ea8
More characters for 'track'
percidae Dec 26, 2021
73a8c6a
Changed some positions in the XML file to better work with pretalx Fa…
percidae Dec 27, 2021
ee06f45
Changed the filename for the fahrplanfiles to a maximum length of 255…
percidae Dec 27, 2021
f022199
Add basic flake
mmarx Dec 27, 2021
17a3f1c
Package django-account
mmarx Dec 27, 2021
c4eaa27
Package django-extensions
mmarx Dec 27, 2021
610f09c
Drop django-urlauth
mmarx Dec 27, 2021
a5af164
Package kanboard API client
mmarx Dec 27, 2021
babb4cf
Fix devshell
mmarx Dec 27, 2021
e18dd53
Add DB configuration to shell
mmarx Dec 27, 2021
193b156
Use psycopg2 < 2.9 for Django-2.2
mmarx Dec 27, 2021
0677a9b
Force consistent ordering of day filter buttons in event page
mmarx Dec 28, 2021
88b302b
Update trint_api_helper.py
percidae Jan 3, 2022
b51cfc2
Update admin.py
percidae Jan 3, 2022
45e5c39
Move kanboard API KEY to credentials
mmarx Jan 3, 2022
f9e0085
With broken template processor
ThoreKr Apr 10, 2021
34d1dc0
Add updated requirements.txt
ThoreKr Apr 10, 2021
8853d96
Update dependencies
ThoreKr Dec 27, 2021
56ffead
Upgrade flake to use poetry2nix
mmarx Dec 27, 2021
69f290d
Move factory-boy & faker to dev dependencies
mmarx Dec 27, 2021
bbfde9b
Allow django 3.2.*
mmarx Dec 27, 2021
fb0f8bf
Update requirements.txt
mmarx Dec 27, 2021
e1e072d
Revert "Move factory-boy & faker to dev dependencies"
mmarx Dec 27, 2021
289597b
Update poetry.lock & requirements.txt
mmarx Dec 27, 2021
4c3da28
Avoid uwsgi in flake since it fails to build with poetry
mmarx Dec 28, 2021
1f523aa
Allow simple HTML style tags in talk abstracts
mmarx Dec 29, 2021
985f551
Fix admin checkbox import
ThoreKr Dec 30, 2021
38ab5fa
Fix trint admin task
percidae Jan 3, 2022
6f7c98e
Add local_settings.py hint to settings.py
mmarx Jan 3, 2022
4070693
Add statistics script
mmarx Dec 30, 2021
fcf1db3
Update admin static files
mmarx Jan 3, 2022
1f415bb
Admin interface for 'talk' now also shows the trint key and can be fi…
percidae Jan 3, 2022
6120acd
Added a webhook for Trint to receive the finished transcripts and sen…
percidae Jan 3, 2022
9fd7973
Fix auth urls
mmarx Jan 5, 2022
c0f2c53
Make transforms `next_ids` argument optional
mmarx Jan 5, 2022
953d3af
Remove broken logging config in sync scripts
mmarx Jan 6, 2022
3dbbadc
Added direct access to the related adim page of an event for users wh…
percidae Jan 12, 2022
661ad30
Files are only uploaded to trint if they are English or German, not i…
percidae Jan 13, 2022
328d370
Minor changes to trint api for later usage of the resulting files
percidae Jan 13, 2022
aa54bb6
Minor changes to beautify the webpage title in the browser
percidae Jan 13, 2022
53bd603
Added both Mastodon Bots to the startpage
percidae Jan 13, 2022
9b462b1
Added credentials/*.secret to ignore mastodon secrets
percidae Jan 13, 2022
b18e403
Added new notifications flags and removed the old to specific flags
percidae Jan 13, 2022
27ba539
Changed the internal comment to a text field for more space for comments
percidae Jan 13, 2022
ec1aea6
Added new notification flags and removed old no longer needed flags
percidae Jan 13, 2022
59eea38
Changed the import to the notifications helper file
percidae Jan 13, 2022
f116143
Changes from old flags to new notification flags
percidae Jan 13, 2022
fed5556
New function for model talk which can be used to send notifications v…
percidae Jan 13, 2022
be94c52
Several functions for model subtitle and notifications
percidae Jan 13, 2022
9d6a305
Subtitle class function to check if the subtitle file really is onlin…
percidae Jan 13, 2022
26ea85f
New admin function for if a transcript is available to send notificat…
percidae Jan 13, 2022
b0f6d6d
Notifications helper library
percidae Jan 13, 2022
b154eaf
New cronjob file which is responsible for the notifications
percidae Jan 13, 2022
66b168e
Removed some no longer needed files
percidae Jan 13, 2022
83c48c5
Removed some absolute path and changed to django relative ones
percidae Jan 13, 2022
f6a9182
New Flag to mark if a talk has a non human subtitle file which is rel…
percidae Jan 14, 2022
92f1d64
Release a draft subtitle file which is downloaded from trint, when th…
percidae Jan 14, 2022
6849efb
Extended the get_trint_transcript function with several parameters e.…
percidae Jan 14, 2022
64bd67a
Extended the get_trint_transcript function with several parameters e.…
percidae Jan 14, 2022
2ead1ae
Made the sending of an email optional via parameter
percidae Jan 14, 2022
1fc15d9
New Subtitle class function which releases a file or a string as draf…
percidae Jan 14, 2022
becff91
Configure Subitlte class function to set the new flag with the right …
percidae Jan 14, 2022
9cef199
media_export has a new column which informs about the source of the d…
percidae Jan 14, 2022
5551a42
Added a new admin function to load a trint transcript without sending…
percidae Jan 14, 2022
a8d9b17
Changed some used pathes from absolute to project relative pathes
percidae Jan 14, 2022
52b2dab
Make sure that a talk where one subtitle is worked on has a very low …
percidae Jan 14, 2022
75901b2
Minor comment addition
percidae Jan 14, 2022
de1ca1c
Changed a used path from an absolute system path to a local one in th…
percidae Jan 14, 2022
43fb3df
Made the function to get the trint transcript possible to be run in t…
percidae Jan 15, 2022
063f809
Bugfix: Change amara update function to recognize Subtitles with only…
percidae Jan 16, 2022
d706b50
Changed the CSV media_export from 'text/plain' to 'text/csv' in mime …
percidae Jan 16, 2022
05fcd92
Some changes to better accomodate Klingon Talks
percidae Jan 16, 2022
717e5e3
Bugfix spelling mistake
percidae Jan 16, 2022
c8b4a1d
Bugfix, spelling mistake
percidae Jan 16, 2022
237b477
Bugfix, mixup of a function and a property
percidae Jan 17, 2022
9fa794f
Added some notification for external draftsto make sure the user know…
percidae Jan 22, 2022
6eddeba
Tiny changes of the text in external subtitles
percidae Jan 22, 2022
673128b
Make the external drafts available als direct download link
percidae Jan 22, 2022
18a4ee0
Updated Mastodon Bots to only post unlisted
percidae Jan 26, 2022
591b8f6
Allow the search via talk_id in the Subtitles Admin Page
percidae Jan 26, 2022
78bf5a0
Add poetry to flake
mmarx Jan 31, 2022
8d0ea1e
Add mastodon.py to dependencies
mmarx Jan 31, 2022
416207c
Only import notifications_bot_helper on demand
mmarx Jan 31, 2022
b4803ac
Drop external requests
mmarx Jan 31, 2022
35dba20
Move DOCTYPE to the front
mmarx Jan 31, 2022
2846fd4
Drop Byte Order Mark in front of DOCTYPE
mmarx Jan 31, 2022
6d3d9ca
Mintor Bugfix, only start downloading the file if it is really needed
percidae Jan 31, 2022
c103bb8
Added a full releasing path function and used it in another function
percidae Jan 31, 2022
1d320de
Merge branch 'main' of github.com:c3subtitles/subtitleStatus into main
percidae Jan 31, 2022
4a9c71f
Bump django from 3.2.11 to 3.2.12
dependabot[bot] Feb 10, 2022
4840da6
Changed the rocket.chat notifications from #subtitles to #subtitles-n…
percidae Mar 5, 2022
a0ed925
Merge branch 'main' of github.com:c3subtitles/subtitleStatus into main
percidae Mar 5, 2022
8a1f961
Changed the rocket.chat notifications from #subtitles to #subtitles-n…
percidae Mar 5, 2022
a8b7759
flake.lock: Update
mmarx Mar 5, 2022
9443fc2
Update requirements.txt
mmarx Mar 5, 2022
7eb3da8
Require explicit opt-in for amara player
mmarx Mar 5, 2022
4568f0b
Fix delayed loading of amara player
mmarx Mar 5, 2022
7808a21
Bump django from 3.2.12 to 3.2.14
dependabot[bot] Jul 5, 2022
46d7aa9
Bump lxml from 4.7.1 to 4.9.1
dependabot[bot] Jul 6, 2022
7498dd4
Bump dependencies
mmarx Jul 6, 2022
5911f2a
Update flake
mmarx Jul 6, 2022
71c39cd
Update .gitignore
mmarx Jul 6, 2022
910f89e
Bump certifi from 2022.6.15 to 2022.12.7
dependabot[bot] Dec 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
55 changes: 55 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: subtitleStatus Tests

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.9]

services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_DB: test_subtitlestatus
POSTGRES_USER: subtitlestatus
POSTGRES_PASSWORD: subtitlestatus
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Prepare configuration
run: |
cat <<EOF > subtitleStatus/subtitleStatus.cfg
[sql]
type=postgresql
host=localhost
port=5432
database=subtitlestatus
user=subtitlestatus
password=subtitlestatus
EOF
- name: Test with django
run: |
python manage.py test --keepdb
21 changes: 18 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ coverage.xml
# Django stuff:
*.log
*.pot
/static/*
www/migrations/
www/static/
/static/*.pdf
www/static/*.txt
www/static/fahrplan_files/
www/static/word_frequencies/
subtitleStatus/settings.py

# Sphinx documentation
Expand All @@ -60,6 +61,7 @@ docs/_build/
# Django
virtualEnv/
subtitleStatus/settings.py
subtitleStatus/local_settings.py

# Downloadsfolder
downloads/*.sbv
Expand All @@ -72,6 +74,8 @@ barbara-temp/

# Credentials files
credentials.py
credentials/credentials.py
credentials/*.secret

# Stuff
temp.py
Expand All @@ -89,3 +93,14 @@ data_dump.py
# Sync Folder
subtitles_sync_folder
subtitles_sync_folder/*
subtitleStatus/subtitleStauts.cfg
.secret

# Google Auth Stuff
ytc-oauth2.json
client_secrets.json

# temporaries
*~
flycheck_*.py
/.direnv/
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
sudo: false
dist: xenial
language: python
services:
- postgresql
python:
- "3.5"
- "3.6"
- "3.7"
cache:
directories:
- $HOME/.cache/pip/wheels
- $HOME/virtualenv
env:
- DJANGO_VERSION=2.1.4
- DJANGO_VERSION=2.1
- DJANGO_VERSION=2
install:
- pip install -q Django==$DJANGO_VERSION
- pip install -r requirements.txt
before_script:
- createuser -U postgres -d subtitlestatus
script:
- python manage.py test
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
subtitleStatus
==============

![subtitleStatus Tests](https://github.com/c3subtitles/subtitleStatus/workflows/subtitleStatus%20Tests/badge.svg)

Setting up a minimal local testing environment:
```
mkvirtualenv subtitlesStatus -p $(which python3)
pip install -r requirements.txt
./init_test_database.sh
python manage.py runserver
```
Empty file added account/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions account/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
23 changes: 23 additions & 0 deletions account/templates/registration/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% extends "base.html" %}

{% block content %}

<form method="post" action="{% url 'auth:login' %}">
{% csrf_token %}
<table>
<tr>
<td>Username</td>
<td><input type="text" name="accountName"/></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="accountPassword"/></td>
</tr>
</table>

<input type="submit" value="login" />
<input type="hidden" name="next" value="{{ next }}" />
</form>

{% endblock %}

16 changes: 16 additions & 0 deletions account/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".

Replace this with more appropriate tests for your application.
"""

from django.test import TestCase


class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
8 changes: 8 additions & 0 deletions account/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.conf.urls import path
from . import views

urlpatterns = [
path('', views.index, name='index'),
path('login/', views.login, name='login'),
path('logout/', views.logout, name='logout'),
]
31 changes: 31 additions & 0 deletions account/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Create your views here.

from django.shortcuts import render, redirect
from django.contrib.auth import authenticate
import django.contrib.auth


def index(request):
pass


def login(request):
if request.user.is_authenticated():
redirect('/')
if request.method == 'POST':
username = request.POST['accountName']
password = request.POST['accountPassword']
user = authenticate(username=username, password=password)
if user is not None and user.is_active:
django.contrib.auth.login(request, user)
if "next" in request.POST:
return redirect(request.POST['next'])
next = "/"
if "next" in request.GET:
next = request.GET['next']
return render(request, 'login.html', {"next": next})


def logout(request):
django.contrib.auth.logout(request)
return redirect('/')
Loading