Compare commits
No commits in common. "be1854d7c1752aaccdecdf66aff40c9e7035b4fc" and "9ab84073d067724ef226555b3f93b34ff4b82718" have entirely different histories.
be1854d7c1
...
9ab84073d0
|
@ -65,10 +65,8 @@ class Job(db.Model, ModelSerializeMixin):
|
|||
end: Optional[datetime] = db.Column(UtcDateTime)
|
||||
type: Union[JobType, int] = db.relationship("JobType")
|
||||
comment: Optional[str] = db.Column(db.String(256))
|
||||
locked: bool = db.Column(db.Boolean(), default=False, nullable=False)
|
||||
services: list[Service] = db.relationship(
|
||||
"Service", back_populates="job_", cascade="save-update, merge, delete, delete-orphan"
|
||||
)
|
||||
locked: bool = db.Column(db.Boolean())
|
||||
services: list[Service] = db.relationship("Service", back_populates="job_")
|
||||
required_services: float = db.Column(db.Numeric(precision=4, scale=2, asdecimal=False), nullable=False)
|
||||
|
||||
event_ = db.relationship("Event", back_populates="jobs")
|
||||
|
|
|
@ -15,6 +15,7 @@ from . import event_controller, permissions, EventPlugin
|
|||
from ...utils.HTTP import no_content
|
||||
|
||||
|
||||
|
||||
def dict_get(self, key, default=None, type=None):
|
||||
"""Same as .get from MultiDict"""
|
||||
try:
|
||||
|
@ -339,11 +340,11 @@ def modify_event(event_id, current_session):
|
|||
event.start = dict_get(data, "start", event.start, type=from_iso_format)
|
||||
event.end = dict_get(data, "end", event.end, type=from_iso_format)
|
||||
event.name = dict_get(data, "name", event.name, type=str)
|
||||
event.description = dict_get(data, "description", event.description, type=str)
|
||||
event.description = dict_get(data, "description", event.description, type=str)
|
||||
if "type" in data:
|
||||
event_type = event_controller.get_event_type(data["type"])
|
||||
event.type = event_type
|
||||
|
||||
|
||||
event_controller.update()
|
||||
return jsonify(event)
|
||||
|
||||
|
@ -426,7 +427,7 @@ def update_job(event_id, job_id, current_session: Session):
|
|||
"""
|
||||
if not current_session.user_.has_permission(permissions.EDIT):
|
||||
raise Forbidden
|
||||
|
||||
|
||||
data = request.get_json()
|
||||
if not data:
|
||||
raise BadRequest
|
||||
|
@ -509,5 +510,4 @@ def lock_job(job_id, current_session: Session):
|
|||
raise BadRequest
|
||||
return no_content()
|
||||
|
||||
|
||||
# TODO: JobTransfer
|
||||
|
|
|
@ -738,7 +738,7 @@ def set_picture(identifier, current_session):
|
|||
|
||||
|
||||
@PriceListPlugin.blueprint.route("/drinks/<int:identifier>/picture", methods=["GET"])
|
||||
# @headers({"Cache-Control": "private, must-revalidate"})
|
||||
#@headers({"Cache-Control": "private, must-revalidate"})
|
||||
def _get_picture(identifier):
|
||||
"""Get Picture
|
||||
|
||||
|
|
Loading…
Reference in New Issue