nonce = Column(Unicode, nullable=False, primary_key=True)
timestamp = Column(DateTime, nullable=False, primary_key=True)
-
-def create_uuid():
- """ Creates a new uuid which is suitable for use in a URL """
- return base64.urlsafe_b64encode(uuid.uuid4().bytes).strip("=")
-
class MediaEntry(Base, MediaEntryMixin):
"""
TODO: Consider fetching the media_files using join
id = request.urlgen(
"mediagoblin.federation.object",
objectType=self.objectType,
- uuid=self.uuid,
+ uuid=self.slug,
qualified=True
)
# not sure why this is 404, maybe ask evan. Maybe 400?
return json_response({"error": error}, status=404)
- media = MediaEntry.query.filter_by(uuid=uuid).first()
+ media = MediaEntry.query.filter_by(slug=uuid).first()
if media is None:
# no media found with that uuid
error = "Can't find a {0} with ID = {1}".format(objectType, uuid)