diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 726d3c6da..d8a33abf5 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -10,6 +10,6 @@ jobs: steps: - uses: actions/checkout@v1 - name: Black Code Formatter - uses: lgeiger/black-action@v1.0.1 + uses: HoiskolensChemikerforening/black-action@v1 #lgeiger/black-action@v1.0.1 with: args: "./chemie --check" diff --git a/chemie/cgp/models.py b/chemie/cgp/models.py index 794287cd9..1dae930c0 100644 --- a/chemie/cgp/models.py +++ b/chemie/cgp/models.py @@ -321,18 +321,16 @@ def get_sorted_groups_list(self): .split(",") ) vote_dict = {vote_list[i]: i for i in range(len(vote_list))} - voteable_groups = self.group.cgp.group_set.exclude(id=self.group.id).exclude( - audience=True - ) + voteable_groups = self.group.cgp.group_set.exclude( + id=self.group.id + ).exclude(audience=True) # Place newly created groups not contained in the previous vote groups last for group in voteable_groups: if group.country.country_name not in vote_dict.keys(): vote_dict[group.country.country_name] = len(vote_list) group_list = sorted( - list( - voteable_groups - ), + list(voteable_groups), key=lambda group: vote_dict[group.country.country_name], ) diff --git a/chemie/cgp/tests/test_forms.py b/chemie/cgp/tests/test_forms.py index 7050e5e9e..c96e8019a 100644 --- a/chemie/cgp/tests/test_forms.py +++ b/chemie/cgp/tests/test_forms.py @@ -10,9 +10,17 @@ def setUp(self): User.objects.create(username="g", password="f", email="sh@hd.com") User.objects.create(username="h", password="hsfd", email="fds@hd.com") self.country = Country.objects.create(country_name="heh", slug="heh") + self.country2 = Country.objects.create( + country_name="heh2", slug="heh2" + ) def test_group_form(self): form = GroupForm( - self.cgp, None, data={"real_name": "hehe", "country": 1} + self.cgp, + None, + data={ + "real_name": "hehe", + "country": self.country.id, + }, ) self.assertTrue(form.is_valid()) diff --git a/chemie/cgp/tests/test_views.py b/chemie/cgp/tests/test_views.py index d5405e6f1..baf83cff8 100644 --- a/chemie/cgp/tests/test_views.py +++ b/chemie/cgp/tests/test_views.py @@ -26,7 +26,7 @@ def test_index_GET(self): response = self.client.get(self.index_url) - self.assertEquals(response.status_code, 200) + self.assertEqual(response.status_code, 200) self.assertTemplateUsed(response, "cgp/index.html") def test_vote_index_GET(self): @@ -39,7 +39,7 @@ def test_vote_index_GET(self): self.cgp.is_open = True self.cgp.save() response = self.client.get(self.vote_index_url) - self.assertEquals(response.status_code, 200) + self.assertEqual(response.status_code, 200) self.assertTemplateUsed(response, "cgp/vote_index.html") @@ -168,6 +168,7 @@ def setUp(self): 4, ], ] + # Points 184 183 130 132 def generateVotes(array, voteString, fiaskovoteindex, showvoteindex): for u in array: @@ -189,4 +190,4 @@ def test_close_election(self): self.cgp.toggle(self.users[0]) self.cgp.toggle(self.users[0]) audiencevote = Vote.objects.get(final_vote=True, group__audience=True) - self.assertEquals(audiencevote.vote[:11], "1c,2c,4c,3c") + self.assertEqual(audiencevote.vote[:11], "1c,2c,4c,3c") diff --git a/chemie/cgp/views.py b/chemie/cgp/views.py index 565752740..fbc7cfd5f 100644 --- a/chemie/cgp/views.py +++ b/chemie/cgp/views.py @@ -131,7 +131,6 @@ def vote_index(request, slug): request, group ) - points = POINTS if request.method == "POST": if not request.POST.get("showprize") or not request.POST.get( diff --git a/chemie/cgp/views_admin.py b/chemie/cgp/views_admin.py index 5af3638d4..6b856695a 100644 --- a/chemie/cgp/views_admin.py +++ b/chemie/cgp/views_admin.py @@ -133,7 +133,7 @@ def group_add(request, cgp_id): ) return redirect(reverse("cgp:cgp_edit", kwargs={"cgp_id": cgp_id})) - context = {"form": form, "type": "Gruppe", "cgp":cgp} + context = {"form": form, "type": "Gruppe", "cgp": cgp} return render(request, "cgp/admin/forms.html", context) diff --git a/chemie/chemie/management/commands/import_emails.py b/chemie/chemie/management/commands/import_emails.py index d2a4343a6..7d7bc939b 100644 --- a/chemie/chemie/management/commands/import_emails.py +++ b/chemie/chemie/management/commands/import_emails.py @@ -15,7 +15,6 @@ EMAIL_TEMPLATE_DIR = os.path.join(settings.BASE_DIR, "emails", "") - class Command(BaseCommand): help = ( "Command for importing email HTML-files. " diff --git a/chemie/chemie/settings/base.py b/chemie/chemie/settings/base.py index 22d36d409..8ed1dfcbe 100644 --- a/chemie/chemie/settings/base.py +++ b/chemie/chemie/settings/base.py @@ -498,9 +498,9 @@ ["Maximize", "Find", "Replace"], ["Table"], ], - 'extraPlugins': 'table', + "extraPlugins": "table", "customConfig": "/static/js/ckeditor_config.js", - } + }, } DEFAULT_CONFIG = CKEDITOR_CONFIGS diff --git a/chemie/chemie/settings/local.py b/chemie/chemie/settings/local.py index 2f31161c2..23b0faf32 100644 --- a/chemie/chemie/settings/local.py +++ b/chemie/chemie/settings/local.py @@ -20,7 +20,4 @@ } } -CORS_ALLOWED_ORIGINS = [ - "http://127.0.0.1:3000", - "http://localhost:3000", -] +CORS_ALLOWED_ORIGINS = ["http://127.0.0.1:3000", "http://localhost:3000"] diff --git a/chemie/chemie/static/images/Fotoboks-010.JPG b/chemie/chemie/static/images/Fotoboks-010.JPG new file mode 100644 index 000000000..2dd00b9ca Binary files /dev/null and b/chemie/chemie/static/images/Fotoboks-010.JPG differ diff --git a/chemie/chemie/static/images/JR-3832.jpg b/chemie/chemie/static/images/JR-3832.jpg new file mode 100644 index 000000000..0cde052b9 Binary files /dev/null and b/chemie/chemie/static/images/JR-3832.jpg differ diff --git a/chemie/chemie/static/images/fotograf1.JPG b/chemie/chemie/static/images/fotograf1.JPG new file mode 100644 index 000000000..d14747721 Binary files /dev/null and b/chemie/chemie/static/images/fotograf1.JPG differ diff --git a/chemie/chemie/static/images/fotograf2.jpg b/chemie/chemie/static/images/fotograf2.jpg new file mode 100644 index 000000000..3aa478b60 Binary files /dev/null and b/chemie/chemie/static/images/fotograf2.jpg differ diff --git a/chemie/chemie/static/js/makeItRain.js b/chemie/chemie/static/js/makeItRain.js index b463003e4..fae1f6cd9 100644 --- a/chemie/chemie/static/js/makeItRain.js +++ b/chemie/chemie/static/js/makeItRain.js @@ -34,10 +34,10 @@ function selectSymbols(choose_your_holiday) { return [ ]; // Return an empty array if the holiday is not recognized } -const chosenHoliday = "webkom"; // Change this to select the holiday you want +const chosenHoliday = "mustache"; // Change this to select the holiday you want const selectedSymbols = selectSymbols(chosenHoliday); -const maxElements = 100; // Maximum number of elements +const maxElements = 70; // Maximum number of elements // Image width and hight const imageWidth = 4 //rem diff --git a/chemie/chemie/templates/chemie/base.html b/chemie/chemie/templates/chemie/base.html index ea2bd5439..130527ca3 100644 --- a/chemie/chemie/templates/chemie/base.html +++ b/chemie/chemie/templates/chemie/base.html @@ -51,7 +51,7 @@
- +