Skip to content

Commit

Permalink
frontend: make the default storage for new projects configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
FrostyX authored and praiskup committed Sep 11, 2024
1 parent 286a913 commit ad36b8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions frontend/coprs_frontend/coprs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ class Config(object):
ROLLING_CHROOTS_INACTIVITY_WARNING = 180
ROLLING_CHROOTS_INACTIVITY_REMOVAL = 180

# What storage should be set for new projects.
# Possible options are "backend" and "pulp"
DEFAULT_STORAGE = "backend"


class ProductionConfig(Config):
DEBUG = False
Expand Down
8 changes: 7 additions & 1 deletion frontend/coprs_frontend/coprs/logic/coprs_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.orm.attributes import get_history

from copr_common.enums import ActionTypeEnum, BackendResultEnum, ActionPriorityEnum
from copr_common.enums import (
ActionTypeEnum,
BackendResultEnum,
ActionPriorityEnum,
StorageEnum,
)
from coprs import app, db
from coprs import exceptions
from coprs import helpers
Expand Down Expand Up @@ -310,6 +315,7 @@ def add(cls, user, name, selected_chroots, repos=None, description=None,
isolation=isolation,
follow_fedora_branching=follow_fedora_branching,
appstream=appstream,
storage=StorageEnum(app.config["DEFAULT_STORAGE"]),
**kwargs)


Expand Down

0 comments on commit ad36b8b

Please sign in to comment.