diff --git a/.github/workflows/heroku-deploy.yml b/.github/workflows/heroku-deploy.yml index eb23860d..fceb5782 100644 --- a/.github/workflows/heroku-deploy.yml +++ b/.github/workflows/heroku-deploy.yml @@ -1,5 +1,5 @@ name: Deploy # The name of the workflow -on: +on: push: branches: - main #Launch the action on every push on the branch main @@ -10,21 +10,9 @@ jobs: - uses: actions/checkout@v2 # This actions copy the repository on the environment - name: Install Heroku CLI # <- IMPORTANT!!! Make sure the cli is installed before using the action run: | - curl https://cli-assets.heroku.com/install.sh | sh + curl https://cli-assets.heroku.com/install.sh | sh - uses: akhileshns/heroku-deploy@v3.12.12 # This action deploys the content on Heroku with: heroku_api_key: ${{secrets.HEROKU_API_KEY}} #The Heroku api key we stored on our repo secret heroku_app_name: "djangosnippets" #The name of your heroku app - Must be unique in Heroku heroku_email: "wedgemail@gmail.com" #Your heroku yuser name - - - - - - - - - - - - diff --git a/.gitignore b/.gitignore index 941e714d..8923ce85 100644 --- a/.gitignore +++ b/.gitignore @@ -175,9 +175,9 @@ cython_debug/ .abstra/ # Visual Studio Code -# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore +# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore -# and can be added to the global gitignore or merged into this file. However, if you prefer, +# and can be added to the global gitignore or merged into this file. However, if you prefer, # you could uncomment the following to ignore the entire vscode folder # .vscode/ diff --git a/.python-version b/.python-version index 902b2c90..2c073331 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.11 \ No newline at end of file +3.11 diff --git a/base/pagination.py b/base/pagination.py index d85e83af..0230420e 100644 --- a/base/pagination.py +++ b/base/pagination.py @@ -30,11 +30,7 @@ def page_range(self): """ Returns the full range of pages. """ - return ( - self.paginator.get_elided_page_range(self.page_num) - if self.multi_page - else [] - ) + return self.paginator.get_elided_page_range(self.page_num) if self.multi_page else [] def setup(self): paginator = Paginator(self.queryset, self.list_per_page) diff --git a/base/templatetags/base_templatetags.py b/base/templatetags/base_templatetags.py index 8cfb0c84..ba5d8112 100644 --- a/base/templatetags/base_templatetags.py +++ b/base/templatetags/base_templatetags.py @@ -50,15 +50,11 @@ def querystring(context, *args, **kwargs): for d in [*args, kwargs]: if not isinstance(d, Mapping): raise TemplateSyntaxError( - "querystring requires mappings for positional arguments (got " - "%r instead)." % d + "querystring requires mappings for positional arguments (got " "%r instead)." % d ) for key, value in d.items(): if not isinstance(key, str): - raise TemplateSyntaxError( - "querystring requires strings for mapping keys (got %r " - "instead)." % key - ) + raise TemplateSyntaxError("querystring requires strings for mapping keys (got %r " "instead)." % key) if value is None: params.pop(key, None) elif isinstance(value, Iterable) and not isinstance(value, str): diff --git a/base/tests/migrations/0002_fish.py b/base/tests/migrations/0002_fish.py index b312f3d2..15d3dd63 100644 --- a/base/tests/migrations/0002_fish.py +++ b/base/tests/migrations/0002_fish.py @@ -6,16 +6,16 @@ class Migration(migrations.Migration): dependencies = [ - ('tests', '0001_initial'), + ("tests", "0001_initial"), ] operations = [ migrations.CreateModel( - name='Fish', + name="Fish", fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=255)), - ('price', models.IntegerField()), + ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("name", models.CharField(max_length=255)), + ("price", models.IntegerField()), ], ), ] diff --git a/cab/forms.py b/cab/forms.py index 83e79348..77629c8e 100644 --- a/cab/forms.py +++ b/cab/forms.py @@ -10,7 +10,7 @@ def validate_non_whitespace_only_string(value): the string to treat strings with only whitespaces in them as empty. """ if not value or not value.strip(): - raise forms.ValidationError(u"This field is required", code="required") + raise forms.ValidationError("This field is required", code="required") class SnippetForm(forms.ModelForm): diff --git a/djangosnippets/static/css/main.css b/djangosnippets/static/css/main.css index a1066d8d..21574ca3 100644 --- a/djangosnippets/static/css/main.css +++ b/djangosnippets/static/css/main.css @@ -6896,4 +6896,4 @@ footer .heroku { a.button:hover { text-decoration: none -} \ No newline at end of file +} diff --git a/djangosnippets/templates/cab/partials/language_list.html b/djangosnippets/templates/cab/partials/language_list.html index d2e14142..3a4c5a3c 100644 --- a/djangosnippets/templates/cab/partials/language_list.html +++ b/djangosnippets/templates/cab/partials/language_list.html @@ -1,7 +1,7 @@ {% load static components %} - +

All languages

- - - - - - diff --git a/djangosnippets/templates/cab/partials/tag_list.html b/djangosnippets/templates/cab/partials/tag_list.html index 9c5b083e..010e94fb 100644 --- a/djangosnippets/templates/cab/partials/tag_list.html +++ b/djangosnippets/templates/cab/partials/tag_list.html @@ -15,7 +15,7 @@

All tags

{% endif %} - - - \ No newline at end of file diff --git a/djangosnippets/wsgi.py b/djangosnippets/wsgi.py index 1ddebb73..eeda71b4 100644 --- a/djangosnippets/wsgi.py +++ b/djangosnippets/wsgi.py @@ -13,6 +13,7 @@ framework. """ + import os from django.core.wsgi import get_wsgi_application diff --git a/ratings/models.py b/ratings/models.py index 0869dc19..8c3e80b3 100644 --- a/ratings/models.py +++ b/ratings/models.py @@ -148,7 +148,7 @@ def add(self, *objs): for obj in objs: if not isinstance(obj, self.model): raise TypeError("'%s' instance expected" % self.model._meta.object_name) - for (k, v) in lookup_kwargs.items(): + for k, v in lookup_kwargs.items(): setattr(obj, k, v) obj.save() diff --git a/theme/apps.py b/theme/apps.py index bec74645..dd24136d 100644 --- a/theme/apps.py +++ b/theme/apps.py @@ -2,4 +2,4 @@ class ThemeConfig(AppConfig): - name = 'theme' + name = "theme"