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

Create django.yml #29

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
dfae2ed
Create django.yml
sindrelothe Mar 29, 2022
220f410
Change files to correct project in pylint command
sindrelothe Mar 29, 2022
1fa6248
change branch name to "main"
sindrelothe Mar 29, 2022
ee538f9
Merge branch 'main' into sindrelothe-patch-1
sindrelothe Apr 21, 2022
2b339e4
fix linting errors for some files
sindrelothe Apr 21, 2022
1835c9b
fix linting errors for choices.py, /fields/__init__, weekday.py
sindrelothe Apr 21, 2022
a4dabe5
Change pylint disable codes to names
sindrelothe Apr 26, 2022
ef09acb
Fix more pylint errors
sindrelothe Apr 26, 2022
6984709
Remove eval function from heroku.py
sindrelothe Apr 26, 2022
d68104b
fix final pylint errors
sindrelothe Apr 26, 2022
6b928a8
fix final pylint error
sindrelothe Apr 26, 2022
32ac51d
merge with main
sindrelothe Apr 26, 2022
79f7de5
remove help_text for Tag class
sindrelothe Apr 26, 2022
b468c80
add trailing comma for lists in tag.py
sindrelothe Apr 26, 2022
b0bcc49
added trailing comma to urls.py
sindrelothe Apr 26, 2022
b6f33be
Add specific exception to apps.py
sindrelothe Apr 26, 2022
bb0ddfb
disable fixme from pylint
sindrelothe Apr 26, 2022
443fd8d
fix migrate bug
sindrelothe Apr 26, 2022
0811664
fix error with github tests
sindrelothe Apr 26, 2022
13a4756
fix error with github tests
sindrelothe Apr 26, 2022
bd767eb
copy fix from rekenett for github tests
sindrelothe Apr 26, 2022
351a541
run migrate before pylint in django.yml'
sindrelothe Apr 26, 2022
576cad0
add settings config to apps.py
sindrelothe Apr 26, 2022
5dfa0d6
remove introduced error in apps.py
sindrelothe Apr 26, 2022
f64388d
add DJANGO_SETTINGS_MODULE to yml script
sindrelothe Apr 26, 2022
78b200c
Update django.yml
sindrelothe Apr 26, 2022
e0581c1
Update django.yml
sindrelothe Apr 26, 2022
2cf9ff5
add new line
sindrelothe Aug 23, 2022
ba0bcd2
fix pipeline
sindrelothe Aug 23, 2022
7df6683
fix pipeline
sindrelothe Aug 23, 2022
9111c6d
move verify migrations to before run pylint in yml
sindrelothe Aug 23, 2022
4946d49
add makemigrations to yml
sindrelothe Aug 23, 2022
227240a
merge main
sindrelothe Sep 27, 2022
31c5fe4
fix merge conflicts
sindrelothe Sep 27, 2022
e859ea0
fix merge conflicts
sindrelothe Sep 27, 2022
ba5254f
update python version in django.yml
sindrelothe Sep 27, 2022
4d1d07e
remove arguments from 'makemigrations' in djano.yml
sindrelothe Sep 27, 2022
a1fba86
remove migrations file
sindrelothe Sep 27, 2022
a0588f9
remove pylint from django.yml
sindrelothe Sep 27, 2022
095ba29
remove run pytest from infoscreen
sindrelothe Sep 27, 2022
b018e31
add linting to django.yml
sindrelothe Sep 27, 2022
ab1d4b3
remove linting of root
sindrelothe Sep 27, 2022
556722f
remove linting of root
sindrelothe Sep 27, 2022
0c2bd5f
use .sh structure to lint
sindrelothe Sep 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions infoscreen/apps.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from django.apps import AppConfig
from django.core import management


class InfoScreenConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'infoscreen'

def ready(self):

from django.core import management

# pylint: disable=bare-except
emilte marked this conversation as resolved.
Show resolved Hide resolved
try:
# https://docs.djangoproject.com/en/3.0/ref/django-admin/#createsuperuser
management.call_command('createsuperuser', interactive=False)
Expand Down
1 change: 1 addition & 0 deletions infoscreen/models/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def get_name(self):
return self.hex

def as_css(self):
# pylint: disable=fixme
emilte marked this conversation as resolved.
Show resolved Hide resolved
# TODO: handle COLOR_RANDOM
# if self.name == root_constants.COLOR_RANDOM:
# return
Expand Down
9 changes: 5 additions & 4 deletions infoscreen/models/fields/restricted_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ class ContentTypeRestrictedFileField(FileField):
250MB - 214958080
500MB - 429916160
"""
def __init__(self, content_types=None, max_upload_size=5242880,*args, **kwargs):

def __init__(self, content_types=None, max_upload_size=5242880, *args, **kwargs):
super().__init__(*args, **kwargs)
self.content_types = content_types
self.max_upload_size = max_upload_size

def clean(self, *args, **kwargs):
def clean(self, *args, **kwargs):
data = super().clean(*args, **kwargs)

file = data.file
Expand All @@ -32,6 +33,6 @@ def clean(self, *args, **kwargs):
else:
raise forms.ValidationError(_('Filetype ikke støttet.'))
except AttributeError:
pass
pass

return data
return data
5 changes: 0 additions & 5 deletions infoscreen/models/tag.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# imports
import re

from django.db import models
from django.db.models import Q
from django.core.exceptions import NON_FIELD_ERRORS, ValidationError

from root import models as root_models

# End: imports -----------------------------------------------------------------
Expand Down
2 changes: 0 additions & 2 deletions infoscreen/tests/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from django.test import TestCase

# Create your tests here.
6 changes: 4 additions & 2 deletions root/settings/heroku.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import
import os
from ast import literal_eval
import django_heroku
from .base import *

ALLOWED_HOSTS = ['info-screens.herokuapp.com']

# Values are set in heroku dashboard
SECRET_KEY = os.environ['SECRET_KEY']
DEBUG = literal_eval(os.environ['DEBUG'])
if os.environ['DEBUG'] == 'True':
DEBUG = True
else:
DEBUG = False
emilte marked this conversation as resolved.
Show resolved Hide resolved

# pylint: disable=undefined-variable
# Ensure correct ENV
Expand Down