Commit f7ead410 authored by andrerim's avatar andrerim
Browse files

Remove unused method with imports

parent d920b8d3
Pipeline #129563 passed with stage
in 55 seconds
import functools
import os
from dataclasses import dataclass
from dataclasses import field
from typing import List
from typing import Type
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.files.storage import FileSystemStorage
from django.db import models
class OverwriteStorage(FileSystemStorage):
"""Filesystem storage for overwriting files."""
def get_available_name(self, name, max_length=None):
"""https://djangosnippets.org/snippets/976/ Returns a filename that's
free on the target storage system, and available for new content to be
written to.
Args:
name (str): Name of the file
max_length (int, optional): Maximum length of a file name. Defaults to None.
"""
if self.exists(name):
os.remove(os.path.join(settings.MEDIA_ROOT, name))
class Workout(models.Model):
"""Django model for a workout that users can log.
......
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