Commit 3b33147f authored by Andreas Rimolsrønning's avatar Andreas Rimolsrønning
Browse files

Merge branch 'backend/refactor/speculative-generality' into 'master'

Remove unused method with imports

See merge request !41
parents c6c70b62 f7ead410
Pipeline #129602 failed with stages
in 1 minute and 33 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