Skip to content

Commit 4c30f91

Browse files
committed
2 parents 1923291 + e99cbb1 commit 4c30f91

14 files changed

Lines changed: 71 additions & 52 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,6 @@ tags
101101
certificates/media
102102
.prettierignore
103103
.parcel-cache/
104+
fixtures/*
105+
backup.zip
104106
exported.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: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,38 @@
1-
#/bin/bash
1+
#!/usr/bin/env bash
22

33
source ~/.pyenv/versions/pycanweb/bin/activate
44

5-
# pg_dump --username pythoncanarias_user --dbname pythoncanarias_web --password > pythoncanarias.db
5+
function dump () {
6+
echo -n "Dumping $1";
7+
./manage.py dumpdata --verbosity 1 --indent 4 $1 > ./fixtures/$1.json
8+
}
69

7-
./manage.py dumpdata about --indent 4 > exported/about.json
8-
./manage.py dumpdata certificates --indent 4 > exported/certificates.json
9-
./manage.py dumpdata certificates --indent 4 > exported/certificates.json
10-
./manage.py dumpdata events --indent 4 > exported/events.json
11-
./manage.py dumpdata invoices --indent 4 > exported/invoices.json
12-
./manage.py dumpdata jobs --indent 4 > exported/jobs.json
13-
./manage.py dumpdata learn --indent 4 > exported/learn.json
14-
./manage.py dumpdata locations --indent 4 > exported/locations.json
15-
./manage.py dumpdata members.member members.membership --indent 4 > exported/members.json
16-
./manage.py dumpdata notices --indent 4 > exported/notices.json
17-
./manage.py dumpdata organizations --indent 4 > exported/organizations.json
18-
./manage.py dumpdata quotes --indent 4 > exported/quotes.json
19-
./manage.py dumpdata schedule --indent 4 > exported/schedule.json
20-
./manage.py dumpdata speakers --indent 4 > exported/speakers.json
21-
./manage.py dumpdata tickets --indent 4 > exported/tickets.json
2210

23-
zip -r exported.zip exported
11+
dumpdata('auth')
12+
dumpdata('about')
13+
dumpdata('api')
14+
dumpdata('admin')
15+
dumpdata('certificates')
16+
dumpdata('contenttypes')
17+
dumpdata('staticfiles')
18+
dumpdata('flatpages')
19+
dumpdata('commons')
20+
dumpdata('events')
21+
dumpdata('homepage')
22+
dumpdata('invoices')
23+
dumpdata('jobs')
24+
dumpdata('learn')
25+
dumpdata('legal')
26+
dumpdata('locations')
27+
dumpdata('members')
28+
dumpdata('messages')
29+
dumpdata('notices')
30+
dumpdata('organizations')
31+
dumpdata('quotes')
32+
dumpdata('schedule')
33+
dumpdata('sessions')
34+
dumpdata('sites')
35+
dumpdata('speakers')
36+
dumpdata('tickets')
2437

38+
zip -r backup.zip fixtures/*.json

0 commit comments

Comments
 (0)