1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 04:50:00 +00:00

Ghetto migrate solution, in case you re-run db_create, it won't add categories again

This commit is contained in:
Yara Naika 2017-05-13 23:51:29 -07:00
parent 3bdff6246f
commit b147cfeb81

View file

@ -5,8 +5,9 @@ from nyaa import app, db, models
db.create_all()
# Insert categories
# Insert categories and insert if it doesn't eixst
existing_cats = models.MainCategory.query.all()
if not existing_cats:
if app.config['SITE_FLAVOR'] == 'nyaa':
CATEGORIES = [
('Anime', ['Anime Music Video', 'English-translated', 'Non-English-translated', 'Raw']),