Skip to content

Commit 574bb10

Browse files
committed
Backup / Pass Ruff checks
1 parent 452d50f commit 574bb10

13 files changed

Lines changed: 74 additions & 29 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,5 @@ tags
100100
certificates/media
101101
.prettierignore
102102
.parcel-cache/
103+
fixtures/*
104+
backup.zip

apps/about/models.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
class Ally(models.Model):
55
'''Organizaciones/Asociaciones aliadas'''
66

7+
class Meta:
8+
ordering = ['name']
9+
verbose_name = 'Aliado'
10+
verbose_name_plural = 'Aliados'
11+
712
name = models.CharField('Nombre', max_length=120)
813
description = models.CharField('Descripción', max_length=220)
914
logo = models.ImageField(upload_to='about/allies/', blank=True)
@@ -14,11 +19,6 @@ class Ally(models.Model):
1419
def __str__(self):
1520
return self.name
1621

17-
class Meta:
18-
ordering = ['name']
19-
verbose_name = 'Aliado'
20-
verbose_name_plural = 'Aliados'
21-
2222

2323
class FAQItem(models.Model):
2424
'''Preguntas frecuentes'''

apps/commons/menu.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import collections
22

33
from django.urls import reverse_lazy
4-
from django.utils.safestring import mark_safe
54

65

76
class MenuItem:

apps/events/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def clean_uuid(self):
100100
if len(uuid) < UUID_LAST_DIGITS:
101101
raise forms.ValidationError(
102102
"Necesito los últimos () letras o dígitos "
103-
"del código".format(UUID_LAST_DIGITS)
103+
"del código"
104104
)
105105
uuid = uuid[-UUID_LAST_DIGITS:]
106106
tickets = list(

apps/events/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def render_all_badges(self, pdf_only=False, remove_badges=True):
325325

326326
class Badge(models.Model):
327327
event = models.ForeignKey("events.Event", on_delete=models.CASCADE)
328-
base_image = models.ImageField(upload_to=f"events/badges/", blank=False)
328+
base_image = models.ImageField(upload_to="events/badges/", blank=False)
329329
# Coordinates start from the top-left corner
330330
name_coordinates = models.CharField(
331331
max_length=255,

apps/invoices/models/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
from .client import Client
2-
from .concept import Concept
3-
from .invoice import Invoice
1+
from .client import Client as Client
2+
from .concept import Concept as Concept
3+
from .invoice import Invoice as Invoice
4+
5+
__all__ = [Client, Concept, Invoice]

apps/jobs/models.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from django.urls import reverse
77

88
from apps.commons.filters import date_from_now
9-
from apps.commons.twitter import Twitter
109
from apps.organizations.models import Organization
1110

1211
# Create your models here.
@@ -95,12 +94,3 @@ def get_full_url(self):
9594
path = reverse('jobs:index') + f'#job{self.pk}'
9695
organization = Organization.load_main_organization()
9796
return urllib.parse.urljoin(organization.url, path)
98-
99-
def save(self, *args, **kwargs):
100-
already_exists = self.pk is not None
101-
super().save(*args, **kwargs)
102-
''' tweepy.error.TweepError: [{'message': 'You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/portal/product', 'code': 453}]
103-
if not already_exists and self.approved:
104-
t = Twitter()
105-
msg = f'💼 Oferta de empleo: {self} {self.get_full_url()}'
106-
t.post(msg)'''

apps/learn/tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
from django.test import TestCase
21

32
# Create your tests here.

apps/tickets/services/ticket_maker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def draw(self):
112112
start_x += 5 * mm
113113
self.canvas.setFont('bold', 10)
114114
self.canvas.drawString(start_x, start_y,
115-
f'Comparte el evento con:')
115+
'Comparte el evento con:')
116116
# hashtag
117117
start_x += 38 * mm
118118
self.canvas.setFont('fira', 9)

export_database.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
./manage.py dumpdata --indent 4 auth > fixtures/auth.json
4+
./manage.py dumpdata --indent 4 about > fixtures/about.json
5+
./manage.py dumpdata --indent 4 api > fixtures/api.json
6+
./manage.py dumpdata --indent 4 admin > fixtures/admin.json
7+
./manage.py dumpdata --indent 4 certificates > fixtures/certificates.json
8+
./manage.py dumpdata --indent 4 contenttypes > fixtures/contenttypes.json
9+
./manage.py dumpdata --indent 4 staticfiles > fixtures/staticfiles.json
10+
./manage.py dumpdata --indent 4 flatpages > fixtures/flatpages.json
11+
./manage.py dumpdata --indent 4 commons > fixtures/commons.json
12+
./manage.py dumpdata --indent 4 events > fixtures/events.json
13+
./manage.py dumpdata --indent 4 homepage > fixtures/homepage.json
14+
./manage.py dumpdata --indent 4 invoices > fixtures/invoices.json
15+
./manage.py dumpdata --indent 4 jobs > fixtures/jobs.json
16+
./manage.py dumpdata --indent 4 learn > fixtures/learn.json
17+
./manage.py dumpdata --indent 4 legal > fixtures/legal.json
18+
./manage.py dumpdata --indent 4 locations > fixtures/locations.json
19+
./manage.py dumpdata --indent 4 members > fixtures/members.json
20+
./manage.py dumpdata --indent 4 messages > fixtures/messages.json
21+
./manage.py dumpdata --indent 4 notices > fixtures/notices.json
22+
./manage.py dumpdata --indent 4 organizations > fixtures/organizations.json
23+
./manage.py dumpdata --indent 4 quotes > fixtures/quotes.json
24+
./manage.py dumpdata --indent 4 schedule > fixtures/schedule.json
25+
./manage.py dumpdata --indent 4 sessions > fixtures/sessions.json
26+
./manage.py dumpdata --indent 4 sites > fixtures/sites.json
27+
./manage.py dumpdata --indent 4 speakers > fixtures/speakers.json
28+
./manage.py dumpdata --indent 4 tickets > fixtures/tickets.json
29+
zip backup.zip fixtures/*.json

0 commit comments

Comments
 (0)