Skip to content

Commit

Permalink
[linters] black quality
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Jun 29, 2023
1 parent 60cba6b commit 84fcaf9
Show file tree
Hide file tree
Showing 40 changed files with 0 additions and 42 deletions.
1 change: 0 additions & 1 deletion lacommunaute/event/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/forum/management/commands/fake_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class Command(BaseCommand):
help = "Generate Fake Contents for dev/demo/validation environments"

def handle(self, **options):

users = UserFactory.create_batch(5, password="password")

forum = create_forum()
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/forum/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/forum/migrations/0002_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class Migration(migrations.Migration):

dependencies = [
("auth", "0012_alter_user_first_name_max_length"),
("forum", "0002_initial"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [
("forum", "0003_forum_invitation_token_forum_members_group"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("forum", "0004_alter_forum_invitation_token"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("forum", "0005_forum_is_highlighted_forum_is_private"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("forum", "0006_forum_target_audience"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("auth", "0012_alter_user_first_name_max_length"),
("forum", "0007_remove_forum_is_highlighted"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("forum", "0008_alter_forum_members_group"),
]
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/forum/migrations/0010_forum_is_newsfeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("forum", "0009_remove_forum_target_audience"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/forum_conversation/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("forum_conversation", "0001_initial"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("forum_conversation", "0002_alter_post_username"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("forum_conversation", "0003_topic_likers"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("forum_conversation", "0004_post_upvoters"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("taggit", "0005_auto_20220424_2025"),
("forum_conversation", "0005_remove_post_upvoters"),
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/forum_conversation/shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

# vincentporte - setup outside models.py to avoid circular imports
def get_posts_of_a_topic_except_first_one(topic: Topic, user: User) -> QuerySet[Post]:

first_post_pk = topic.first_post.pk if topic.first_post else None

qs = topic.posts.exclude(Q(approved=False) | Q(pk=first_post_pk))
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/forum_conversation/tests/tests_views_htmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def test_loadmoretopic_url(self):
self.assertEqual(response.context_data["loadmoretopic_suffix"], "topicsinforum")

def test_numqueries_vs_tags(self):

tags = Tag.objects.bulk_create([Tag(name=f"tag{i}", slug=f"tag{i}") for i in range(5)])
for topic in TopicFactory.create_batch(20, forum=self.topic.forum, with_post=True):
topic.tags.add(", ".join(tag.name for tag in tags))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class Command(BaseCommand):
help = "Collecter le nombre d'evenements par semaine et par mois"

def handle(self, *args, **options):

for period, search_date in (
("month", timezone.make_aware(datetime(2023, 1, 1), timezone.get_current_timezone())),
("week", timezone.make_aware(datetime(2023, 1, 2), timezone.get_current_timezone())),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def add_arguments(self, parser):
parser.add_argument("--period", type=str, help="['day','week','month']", default="day")

def handle(self, *args, **options):

period = options["period"]

from_date = Stat.objects.filter(period=period).order_by("-date").first()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def add_arguments(self, parser):
parser.add_argument("--month", type=int, help="month without leading zero", default=3)

def handle(self, *args, **options):

month = options["month"]
year = options["year"]

Expand Down
1 change: 0 additions & 1 deletion lacommunaute/forum_stats/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
2 changes: 0 additions & 2 deletions lacommunaute/forum_upvote/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class UpVoteAdmin(admin.ModelAdmin):

list_display = ("voter", "post", "created_at")
raw_id_fields = (
"voter",
Expand All @@ -13,7 +12,6 @@ class UpVoteAdmin(admin.ModelAdmin):


class CertifiedPostAdmin(admin.ModelAdmin):

list_display = ("topic", "post", "user")
raw_id_fields = (
"topic",
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/forum_upvote/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/forum_upvote/migrations/0002_certifiedpost.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [
("forum_conversation", "0005_remove_post_upvoters"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/inclusion_connect/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ class Command(BaseCommand):
help = "Ajouter un utilisateur à une liste Sendinblue quand il s'inscrit"

def handle(self, *args, **options):

add_user_to_list_when_register()
self.stdout.write(self.style.SUCCESS("That's all, folks!"))
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ class Command(BaseCommand):
help = "Envoyer une notification par email à l'auteur d'un sujet quand il y a une première réponse"

def handle(self, *args, **options):

send_notifs_when_first_reply()
self.stdout.write(self.style.SUCCESS("That's all, folks!"))
1 change: 0 additions & 1 deletion lacommunaute/notification/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [
("notification", "0001_initial"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("notification", "0002_emailsenttrack_kind"),
]
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/notification/migrations/0004_bouncedemail.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("notification", "0003_alter_emailsenttrack_kind"),
]
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/users/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/utils/matomo.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ def collect_stats_from_matomo_api(period="day", from_date=date(2022, 12, 5), to_
keys = {"day": "nb_uniq_visitors", "week": "sum_daily_nb_uniq_visitors", "month": "sum_daily_nb_uniq_visitors"}
stats = []
while from_date <= to_date:

stats += get_matomo_visits_data(period, from_date)
stats += get_matomo_events_data(period, from_date, nb_uniq_visitors_key=keys[period], label="engagement")
print(f"Stats collected for {period} {from_date} ({len(stats)} stats collected)")
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/utils/templatetags/date_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

@register.filter(is_safe=False)
def relativetimesince_fr(d):

if not isinstance(d, datetime.datetime):
d = datetime.datetime(d.year, d.month, d.day)

Expand Down
2 changes: 0 additions & 2 deletions lacommunaute/utils/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ def urlize(text, trim_url_limit=None, nofollow=False, autoescape=False):


def get_safe_url(request, param_name=None, fallback_url=None, url=None):

url = url or request.GET.get(param_name) or request.POST.get(param_name)

allowed_hosts = settings.ALLOWED_HOSTS
require_https = request.is_secure()

if url:

if settings.DEBUG:
# In DEBUG mode the network location part `127.0.0.1:8000` contains
# a port and fails the validation of `url_has_allowed_host_and_scheme`
Expand Down

0 comments on commit 84fcaf9

Please sign in to comment.