Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 2 additions & 14 deletions .github/workflows/heroku-deploy.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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/[email protected] # 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: "[email protected]" #Your heroku yuser name












4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11
3.11
6 changes: 1 addition & 5 deletions base/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 2 additions & 6 deletions base/templatetags/base_templatetags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
10 changes: 5 additions & 5 deletions base/tests/migrations/0002_fish.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
],
),
]
2 changes: 1 addition & 1 deletion cab/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion djangosnippets/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -6896,4 +6896,4 @@ footer .heroku {

a.button:hover {
text-decoration: none
}
}
2 changes: 1 addition & 1 deletion djangosnippets/templates/cab/partials/language_list.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load static components %}


<img class="bars" src="{% static 'img/bars.svg' %}"/>
<img class="bars" src="{% static 'img/bars.svg' %}"/>
<h1>All languages</h1>
<div id="content">
<ul>
Expand Down
6 changes: 0 additions & 6 deletions djangosnippets/templates/cab/partials/most_bookmarked.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,3 @@ <h3>Filter by date</h3>

<p><a rel="alternate" href="{% url 'cab_feed_latest' %}" type="application/atom+xml"><i class="fa fa-fw fa-rss-square"></i>Feed of latest snippets</a></p>
</div>






3 changes: 1 addition & 2 deletions djangosnippets/templates/cab/partials/tag_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h1>All tags</h1>
{% endif %}

</div>
<div id="sidebar">
<div id="sidebar">
<h2>Most popular tags</h2>

<ol>
Expand All @@ -24,4 +24,3 @@ <h2>Most popular tags</h2>
{% endfor %}
</ol>
</div>

2 changes: 0 additions & 2 deletions djangosnippets/templates/cab/partials/top_authors.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,3 @@ <h1>Top authors</h1>
</tbody>
</table>
</div>


1 change: 1 addition & 0 deletions djangosnippets/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
framework.

"""

import os

from django.core.wsgi import get_wsgi_application
Expand Down
2 changes: 1 addition & 1 deletion ratings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion theme/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class ThemeConfig(AppConfig):
name = 'theme'
name = "theme"