|     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

Verified Commit ded46205 authored by Emi Simpson's avatar Emi Simpson
Browse files

Fix bug: Not changing the slug for a project results in a crash

parent bb5f4a60
Pipeline #870 passed with stages
in 2 minutes and 49 seconds
......@@ -19,6 +19,7 @@ from hashlib import md5
from mystic.sources import SOURCE_PROCESSORS, Source
from functools import reduce
import random
from typing import Any, List, Optional, Dict, Tuple, Type, Union, cast
from pymysql.cursors import Cursor
......@@ -383,7 +384,7 @@ class Project:
'INSERT INTO projects(slug, display_name, description, draft_owner) VALUES (%s, %s, %s, %s);',
(f'draft-placeholder-{draft_owner.user_id}', '', '', draft_owner.user_id)
(f'draft-placeholder-{random.randint(0, 2**32):x}', '', '', draft_owner.user_id)
except IntegrityError:
raise NonexistantId('user', draft_owner.user_id)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment