Verified Commit 68a85a3f authored by Peter Stanko's avatar Peter Stanko
Browse files

Custom Resource Definition: Update/Create endpoints + tests

parent e61f24c2
Pipeline #31345 passed with stage
in 7 minutes and 17 seconds
= Portal Changelog
[2019-04-09] - Resource definition support - dump course with entities as YAML
[2019-04-08] - Project config parameters as YAML
[2019-04-07] - Get versions - commit id and message `/management/versions`
[2019-04-07] - Ability to extract `gitlab_token` from `cookies` and `headers`
......
......@@ -31,6 +31,7 @@ muni-is-api = {editable = true,git = "https://git@gitlab.fi.muni.cz/grp-kontr2/i
authlib = "*"
pip = "*"
git-url-parse = "*"
python-dateutil = "*"
[dev-packages]
pylint = "*"
......
{
"_meta": {
"hash": {
"sha256": "fb54e655610778f3b413b4aafccf990e375eaa0522e0e8ca744ab084e827a968"
"sha256": "24bfa7becaf7a9f10d4322af7740f932332a48fb7e32c9f0b8a45337fffa36d9"
},
"pipfile-spec": 6,
"requires": {
......@@ -224,10 +224,10 @@
},
"flask-jwt-extended": {
"hashes": [
"sha256:68035dba637fd58c0f0b308e49103cba7f6977aa301d958ddbd7b811a91c6dec"
"sha256:c942e22aa4d523d6021bf4ce5d37d08d7423a94a756efc31aab13e1f44a82551"
],
"index": "pypi",
"version": "==3.18.0"
"version": "==3.18.1"
},
"flask-migrate": {
"hashes": [
......@@ -308,10 +308,10 @@
},
"jinja2": {
"hashes": [
"sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd",
"sha256:f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4"
"sha256:065c4f02ebe7f7cf559e49ee5a95fb800a9e4528727aec6f24402a5374c65013",
"sha256:14dd6caf1527abb21f08f86c784eac40853ba93edb79552aa1e4b8aef1b61c7b"
],
"version": "==2.10"
"version": "==2.10.1"
},
"jsonschema": {
"hashes": [
......@@ -471,37 +471,37 @@
},
"psycopg2-binary": {
"hashes": [
"sha256:0c8cb1b93e25eaf1dfedbcb4cee4ce3860035ce216b71590bda5f8dc99128526",
"sha256:1c2eeb074d2be404f22a14c4c71eeaa1a855c940abedf6f726158348e9c83dd6",
"sha256:1d879395a5d0dfe191dcfc622dce8b0a5e4fb76d089c903f18a4913e5fbc79c7",
"sha256:20d47c61bc9d6a431039f6ceb3b9a34a952a1562cf718054f64c524526fb8ed8",
"sha256:39fc9323f065361b99fca7758ac723d7e66bbc7e6ec9c90e398857af0ef61404",
"sha256:3c5b7579f3075f19b0b54495d28105049d44564d67b817eef2fa561b2bcf532b",
"sha256:3f811db92e30ea2412dfba8e64b18102017646969b5f436138d7b2b38a0e8966",
"sha256:41d60c8610a70b6666641b662379ef3b847ad2acd38303d4c8e34efd0f782403",
"sha256:45979c708536a3132398863579280657c6bc77e9b9be8b05ba0dae9013b5a0a8",
"sha256:4aaa54574b52b85223d3d950b2fc77bd672e6fbb324bb99f834eacbedc4545f7",
"sha256:50647aa5f7171153a5f7fa667f99f55468b9b663b997927e4d2e83955b21aa9f",
"sha256:528175ab1f12131bb5ea0df64fc524a4c6c51c197dc68d2a9e646029890d4d0f",
"sha256:5cbb49cc1c3c4c69ba09a7e18452bd44371b6adad0c9636f117a7554660af529",
"sha256:6e2f69635b548147e9b9298f5b67155d212f742683e51d78d24ceec4a3f5464d",
"sha256:7994d43431f1b9eba5daa1bdb8f626482cf01e379c00967092c6ebb3e4d3235f",
"sha256:86ec556a75f7e0124581100f2c4c8f9c8d67fc6254af4ce500633a77a4ca3207",
"sha256:9c32635fca3c250f5a3d2e424819419cd4a0f277c1a383b20fdd95e799d1da7c",
"sha256:9e19396065fdbbbc7c0b288a4e70694e1e63593388020fdb86076b12c315bda5",
"sha256:a9e7606233fa6c559491758cb319fab6cec25d931cdb5db670c434dde44ab56b",
"sha256:c914312ad7c923ac154821fbd591e8482ab03cdb190e14b05e30bf856f69e98c",
"sha256:d354ebb06f851f5f2cbc675bbb1369f71091aec6a894986d68341cbca59e7e56",
"sha256:d35a25989112c07a994070f1b3c711b19a14209c7608802eced3bcbf07c375bb",
"sha256:d71c128151c2d93fab36d7273b6a6696a63e0aa03ba3f7b1b0abb862c2344765",
"sha256:d77e4cbecc30f3a8406873c83075c5dae9dcd2ba1c0ffb088edd29372d3df84c",
"sha256:dd0b68d212d0992e2a906c6c34a1ef3f82b3dba74ff99744c77f390ffecb0cca",
"sha256:f0f97d3e0ab12456733687fc99d05e4de67f12d48a57c3baf1f5a1c6cd76c876",
"sha256:f7b72646a5a50aed8535d8cd2d7e915238f389c181d20143f67c2c6527ca5d0e",
"sha256:fd06663aa38b2b7b1f71017329545e17f2a583b127de4eeaabdc4cb16cf3a942"
"sha256:163d3ee445a0b4c0109877da9e46271aacf4e5e3d60ae7368669555c30f13e7c",
"sha256:1af0bfe7b0c13a0e613a27311fd4f9c5d024e8fc0f4b3d284e7df02a58a11fc0",
"sha256:2169c3a1bf52d5b30cc98625b5919a964c571a32e8646be20be6c7e3e82079de",
"sha256:218f079fa48e2ef812dc3d3ce6ec2f67ac56427ba4b038d5d6331f2cceb489c2",
"sha256:26a958930687e94c4c6c73c171e4d4783b82ae4e16aa3424e6bcd4529bceedf0",
"sha256:2c7c195aef3acdbc853942bc674844031a732890d2fee88a324298ed376b6c2b",
"sha256:2ecdbfed7004669472bfa27c8d51012c717c241c7154ae17e4c8f93024043525",
"sha256:345fc31b71a90ada1b51826537917b19a1af685a91c0f066787069c184d7d00f",
"sha256:378a06649503f548be5f1e9eec2e94cc1d6138250b82a08dcc6151bca8cec107",
"sha256:3f300bf2930e501dde09605de85cb2b84c2638e2c954be02a3c86f28176d3525",
"sha256:6c2f66c653ce8bbd7e789d0f7f92c3f9fea881b55226f0ae5ee550cce9e3cf0e",
"sha256:6fccbac2633831b877a8fbf865f7082d34895e82a015795a9f80f99a2efe2576",
"sha256:7a166f8ccb6888358d3e67795b057540ea7caa71ab9e089b0cb0097f01088965",
"sha256:8f6b84f887ec6fef6c1796779f8ec2603dc7e9ef52bc9269de719d4bcbdaebbb",
"sha256:92cf3ceb7bb90cf35b8bd993c640b15d4832ba0e142a3b9da5006ef217da595d",
"sha256:a20dfdf73f56da674926a3811929cff9fd23b9af90be9a6c36ac246a3486eef3",
"sha256:a84415df4689251556c961e4fe3b25d30e32f00faa8064ce0909458dbe0d67b2",
"sha256:ab1aa1cd50df3860f624c9713ee9e690eefd4e049d3a4d86577bab6e741e9616",
"sha256:abc9dcf85e75a8687f2a6d560c0c1a2593e8e34ba6f9ad6721f8212c5de179a2",
"sha256:c10454710a81a2f4b1ff4d1c83ac2cec63e0e55845a56324991514af5b1299d0",
"sha256:c38f80719e4dfae7a6311a4f091f07f4fb2fb5d602352015d5639f63f8fabb68",
"sha256:d75cf00605630b2cfefa5c62373c605dcda1cc0d607902847dbb8e8e9b67c1ce",
"sha256:dce15cb6ef604c9e38fdaa848f58f83153ade9f4aa5e4cf5812aa27163561750",
"sha256:e7e0db4311bb76bf3f6e0380f71912cfa6d0be7cc635e3772476050b0dabdabd",
"sha256:eac59cae78dfe3fbf7ece25c170d7a152f88df7643381aa5e7344c2028a8d8d4",
"sha256:ead7b3e1567bd14cacd44279c5e42cd19f54b9feed39180220253f4fbe3abd56",
"sha256:ed772a5e8e7e5dd6bede960a86940c17cf653c7f158dafa5d52e919b676f10ba",
"sha256:f2d73131acb94afa45de8b6b8a4bfb21bbe3736633d6478e53247f19dd8c299c"
],
"index": "pypi",
"version": "==2.8"
"version": "==2.8.1"
},
"pyasn1": {
"hashes": [
......@@ -542,6 +542,7 @@
"sha256:7e6584c74aeed623791615e26efd690f29817a27c73085b78e4bad02493df2fb",
"sha256:c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e"
],
"index": "pypi",
"version": "==2.8.0"
},
"python-dotenv": {
......@@ -577,11 +578,11 @@
},
"pytz": {
"hashes": [
"sha256:32b0891edff07e28efe91284ed9c31e123d84bea3fd98e1f72be2508f43ef8d9",
"sha256:d5f05e487007e29e03409f9398d074e158d920d36eb82eaf66fb1136b0c5374c"
"sha256:303879e36b721603cc54604edcac9d20401bdbe31e1e4fdee5b9f98d5d31dfda",
"sha256:d747dd3d23d77ef44c6a3526e274af6efeb0a6f1afd5a69ba4d5be4098c8e141"
],
"index": "pypi",
"version": "==2018.9"
"version": "==2019.1"
},
"pyyaml": {
"hashes": [
......@@ -774,10 +775,10 @@
},
"isort": {
"hashes": [
"sha256:08f8e3f0f0b7249e9fad7e5c41e2113aba44969798a26452ee790c06f155d4ec",
"sha256:4e9e9c4bd1acd66cf6c36973f29b031ec752cbfd991c69695e4e259f9a756927"
"sha256:01cb7e1ca5e6c5b3f235f0385057f70558b70d2f00320208825fa62887292f43",
"sha256:268067462aed7eb2a1e237fcb287852f22077de3fb07964e87e00f829eea2d1a"
],
"version": "==4.3.16"
"version": "==4.3.17"
},
"lazy-object-proxy": {
"hashes": [
......@@ -895,10 +896,10 @@
},
"pyparsing": {
"hashes": [
"sha256:66c9268862641abcac4a96ba74506e594c884e3f57690a696d21ad8210ed667a",
"sha256:f6c5ef0d7480ad048c054c37632c67fca55299990fff127850181659eea33fc3"
"sha256:1873c03321fc118f4e9746baf201ff990ceb915f433f23b395f5580d1840cb2a",
"sha256:9b6323ef4ab914af344ba97510e966d64ba91055d6b9afa6b30799340e89cc03"
],
"version": "==2.3.1"
"version": "==2.4.0"
},
"pytest": {
"hashes": [
......
......@@ -15,7 +15,6 @@ import portal
from management.data import DataManagement
from portal import create_app, db, logger
log = logger.get_logger(__name__)
data_cli = AppGroup('data', help='Sample data initialization')
......@@ -48,7 +47,7 @@ def cli_print_cfg(ctx):
print(f"{key}: {val}")
@devel_cli.command('run', help='Runs the devel server with iniializes db')
@devel_cli.command('run', help='Runs the devel server with initializes db')
@click.option('-p', '--port', default=8000)
@click.pass_context
def cli_run_devel(ctx, port):
......@@ -69,9 +68,10 @@ def cli_init_data(env):
manager.init_data(env)
#
# Users related commands
#
"""
USERS
"""
@users_cli.command('create', help='Create admin user')
@click.argument('name')
......@@ -128,9 +128,10 @@ def cli_users_list(course, role, group, file):
manager.import_users(file, course=course, role=role, group=group)
#
# Courses related commands
#
"""
COURSES
"""
@courses_cli.command('create', help="Creates course with default roles")
@click.argument('name', )
......@@ -139,6 +140,13 @@ def cli_course_creates(name):
manager.create_course(name)
@courses_cli.command('definition', help="Shows course definition")
@click.argument('name', )
def cli_course_creates(name):
log.info(f"[CMD] Definition for the Course: {name}")
manager.dump_definition(name)
@courses_cli.command('list', help="List courses")
def cli_courses_list():
log.info(f"[CMD] List Courses")
......@@ -164,6 +172,11 @@ def cli_course_role_creates(course, role_name):
manager.is_import_users(course, role_name=role_name, users_type='teachers')
"""
PROJECTS
"""
@projects_cli.command('activate', help="activates project")
@click.option('-p', '--project')
@click.option('-c', '--course')
......@@ -179,6 +192,11 @@ def cli_projects_list(course):
manager.list_projects(course)
"""
SUBMISSIONS
"""
@submissions_cli.command('cancel-all', help="Cancel all submissions")
def cli_submissions_cancel_all():
log.info(f"[CMD] Cancelling all submissions")
......
......@@ -2,6 +2,7 @@ import csv
import datetime
import sys
import yaml
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
......@@ -271,3 +272,8 @@ class DataManagement:
def is_sync_seminaries(self, course: str):
course = self.find.course(course)
self.services.is_api(course).sync_seminaries()
def dump_definition(self, name: str):
course = self.find.course(name)
schema = self.services.resource_definition.dump_course(course=course)
print(yaml.safe_dump(schema, sort_keys=False))
codename: pb071
name: "Programov\xE1n\xED v jazyce C"
description: "Programov\xE1n\xED v jazyce C's description"
notes_access_token: PB071_token
projects:
- codename: mini010
name: MINI010
description: MINI010's description
submit_configurable: true
config:
test_files_source: git@gitlab.fi.muni.cz:xstanko2/pb071-mini-template.git
file_whitelist: '*.*'
pre_submit_script: ''
post_submit_script: ''
test_files_subdir: mini010
submission_parameters: '{"type":"text"}'
submission_scheduler_config: ''
submissions_allowed_from: '2019-04-08T20:40:00+00:00'
submissions_allowed_to: '2020-02-03T20:40:00+00:00'
archive_from: '2020-03-04T20:40:00+00:00'
- codename: mini011
name: MINI011
description: MINI011's description
submit_configurable: false
config:
test_files_source: git@gitlab.fi.muni.cz:xstanko2/pb071-mini-template.git
file_whitelist: '*.*'
pre_submit_script: ''
post_submit_script: ''
test_files_subdir: mini011
submission_parameters: '{"type":"text"}'
submission_scheduler_config: ''
submissions_allowed_from: '2019-04-08T20:40:00+00:00'
submissions_allowed_to: '2020-02-03T20:40:00+00:00'
archive_from: '2020-03-04T20:40:00+00:00'
- codename: mini012
name: MINI012
description: MINI012's description
submit_configurable: true
config:
test_files_source: git@gitlab.fi.muni.cz:xstanko2/pb071-mini-template.git
file_whitelist: '*.*'
pre_submit_script: ''
post_submit_script: ''
test_files_subdir: mini012
submission_parameters: '{"type":"text"}'
submission_scheduler_config: ''
submissions_allowed_from: '2019-04-08T20:40:00+00:00'
submissions_allowed_to: '2020-02-03T20:40:00+00:00'
archive_from: '2020-03-04T20:40:00+00:00'
- codename: mini02
name: MINI02
description: MINI02's description
submit_configurable: true
config:
test_files_source: git@gitlab.fi.muni.cz:xstanko2/pb071-mini-template.git
file_whitelist: '*.*'
pre_submit_script: ''
post_submit_script: ''
test_files_subdir: mini02
submission_parameters: '{"type":"text"}'
submission_scheduler_config: ''
submissions_allowed_from: '2019-04-08T20:40:00+00:00'
submissions_allowed_to: '2020-02-03T20:40:00+00:00'
archive_from: '2020-03-04T20:40:00+00:00'
- codename: mini03
name: MINI03
description: MINI03's description
submit_configurable: false
config:
test_files_source: git@gitlab.fi.muni.cz:xstanko2/pb071-mini-template.git
file_whitelist: '*.*'
pre_submit_script: ''
post_submit_script: ''
test_files_subdir: mini03
submission_parameters: '{"type":"text"}'
submission_scheduler_config: ''
submissions_allowed_from: '2019-04-08T20:40:00+00:00'
submissions_allowed_to: '2020-02-03T20:40:00+00:00'
archive_from: '2020-03-04T20:40:00+00:00'
- codename: mini04
name: MINI04
description: MINI04's description
submit_configurable: true
config:
test_files_source: git@gitlab.fi.muni.cz:xstanko2/pb071-mini-template.git
file_whitelist: '*.*'
pre_submit_script: ''
post_submit_script: ''
test_files_subdir: mini04
submission_parameters: '{"type":"text"}'
submission_scheduler_config: ''
submissions_allowed_from: '2019-04-08T20:40:00+00:00'
submissions_allowed_to: '2020-02-03T20:40:00+00:00'
archive_from: '2020-03-04T20:40:00+00:00'
- codename: mini05
name: MINI05
description: MINI05's description
submit_configurable: false
config:
test_files_source: git@gitlab.fi.muni.cz:xstanko2/pb071-mini-template.git
file_whitelist: '*.*'
pre_submit_script: ''
post_submit_script: ''
test_files_subdir: mini05
submission_parameters: '{"type":"text"}'
submission_scheduler_config: ''
submissions_allowed_from: '2019-04-08T20:40:00+00:00'
submissions_allowed_to: '2020-02-03T20:40:00+00:00'
archive_from: '2020-03-04T20:40:00+00:00'
- codename: mini06
name: MINI06
description: MINI06's description
submit_configurable: true
config:
test_files_source: git@gitlab.fi.muni.cz:xstanko2/pb071-mini-template.git
file_whitelist: '*.*'
pre_submit_script: ''
post_submit_script: ''
test_files_subdir: mini06
submission_parameters: '{"type":"text"}'
submission_scheduler_config: ''
submissions_allowed_from: '2019-04-08T20:40:00+00:00'
submissions_allowed_to: '2020-02-03T20:40:00+00:00'
archive_from: '2020-03-04T20:40:00+00:00'
- codename: mini07
name: MINI07
description: MINI07's description
submit_configurable: false
config:
test_files_source: git@gitlab.fi.muni.cz:xstanko2/pb071-mini-template.git
file_whitelist: '*.*'
pre_submit_script: ''
post_submit_script: ''
test_files_subdir: mini07
submission_parameters: '{"type":"text"}'
submission_scheduler_config: ''
submissions_allowed_from: '2019-04-08T20:40:00+00:00'
submissions_allowed_to: '2020-02-03T20:40:00+00:00'
archive_from: '2020-03-04T20:40:00+00:00'
- codename: mini08
name: MINI08
description: MINI08's description
submit_configurable: true
config:
test_files_source: git@gitlab.fi.muni.cz:xstanko2/pb071-mini-template.git
file_whitelist: '*.*'
pre_submit_script: ''
post_submit_script: ''
test_files_subdir: mini08
submission_parameters: '{"type":"text"}'
submission_scheduler_config: ''
submissions_allowed_from: '2019-04-08T20:40:00+00:00'
submissions_allowed_to: '2020-02-03T20:40:00+00:00'
archive_from: '2020-03-04T20:40:00+00:00'
- codename: mini09
name: MINI09
description: MINI09's description
submit_configurable: false
config:
test_files_source: git@gitlab.fi.muni.cz:xstanko2/pb071-mini-template.git
file_whitelist: '*.*'
pre_submit_script: ''
post_submit_script: ''
test_files_subdir: mini09
submission_parameters: '{"type":"text"}'
submission_scheduler_config: ''
submissions_allowed_from: '2019-04-08T20:40:00+00:00'
submissions_allowed_to: '2020-02-03T20:40:00+00:00'
archive_from: '2020-03-04T20:40:00+00:00'
roles:
- codename: owner
name: owner
description: Owner's role
permissions:
create_submissions: false
create_submissions_other: false
view_course_limited: false
view_course_full: true
update_course: true
handle_notes_access_token: true
write_roles: true
write_groups: true
write_projects: true
resubmit_submissions: true
evaluate_submissions: true
read_submissions_all: true
read_submissions_groups: false
read_submissions_own: false
read_reviews_all: false
read_reviews_groups: false
read_reviews_own: false
write_reviews_all: true
write_reviews_group: false
write_reviews_own: false
- codename: student
name: student
description: Student's role
permissions:
create_submissions: true
create_submissions_other: false
view_course_limited: true
view_course_full: false
update_course: false
handle_notes_access_token: false
write_roles: false
write_groups: false
write_projects: false
resubmit_submissions: false
evaluate_submissions: false
read_submissions_all: false
read_submissions_groups: false
read_submissions_own: true
read_reviews_all: false
read_reviews_groups: false
read_reviews_own: false
write_reviews_all: false
write_reviews_group: false
write_reviews_own: true
- codename: teacher
name: teacher
description: Teacher's role
permissions:
create_submissions: true
create_submissions_other: true
view_course_limited: false
view_course_full: true
update_course: true
handle_notes_access_token: false
write_roles: false
write_groups: true
write_projects: true
resubmit_submissions: true
evaluate_submissions: true
read_submissions_all: true
read_submissions_groups: true
read_submissions_own: false
read_reviews_all: false
read_reviews_groups: false
read_reviews_own: false
write_reviews_all: true
write_reviews_group: false
write_reviews_own: false
- codename: worker
name: worker
description: Worker's role
permissions:
create_submissions: true
create_submissions_other: false
view_course_limited: false
view_course_full: true
update_course: false
handle_notes_access_token: false
write_roles: false
write_groups: false
write_projects: false
resubmit_submissions: true
evaluate_submissions: true
read_submissions_all: true
read_submissions_groups: false
read_submissions_own: false
read_reviews_all: false
read_reviews_groups: false
read_reviews_own: false
write_reviews_all: true
write_reviews_group: false
write_reviews_own: false
groups:
- codename: students
name: students
description: students's description
- codename: teachers
name: teachers
description: teachers's description
......@@ -53,14 +53,6 @@ class ClientType(enum.Enum):
class Client(db.Model):
"""Client entity model
Attributes:
id: UUID string
name: custom name for the secret
type: client type (worker or user)
- secrets: a list of secrets for this client
- roles: roles associated with this client
- owner_id: reference to the enclosing entity of the client
"""
__tablename__ = 'client'
id = db.Column(db.String(length=36), default=lambda: str(
......@@ -341,14 +333,6 @@ def _get_class_based_on_client_type(client_type):
class Course(db.Model, EntityBase, NamedMixin):
"""Course model
Attributes:
id: UUID string
name: Human readable name of the course
codename: Code name of the course
notes_access_token: Access code that can be used to write to IS MUNI notes API
roles: List of roles associated to a course
groups: List of groups associated to a course
projects: List of projects associated to a course
"""
EXCLUDED = ['notes_access_token', 'roles', 'groups', 'projects']
__tablename__ = 'course'
......@@ -374,17 +358,21 @@ class Course(db.Model, EntityBase, NamedMixin):
def is_api_enabled(self) -> bool:
return self.notes_access_token is not None and self.notes_access_token != ""
def __init__(self, name: str = None, codename: str = None,
description: str = None) -> None:
def __init__(self, name: str = None, codename: str = None, notes_access_token: str = None,
description: str = None, faculty_id: int = None) -> None:
"""Creates course instance
Args:
description (str): Course's description
name(str): Course name
codename(str): Course codename
faculty_id(int): Faculty id
notes_access_token: IS MUNI Notepads access token
"""
self.name = name
self.codename = codename or name
self.description = description
self.notes_access_token = notes_access_token
self.faculty_id = faculty_id
def __repr__(self):
return _repr(self)
......@@ -515,16 +503,18 @@ class Project(db.Model, EntityBase, NamedMixin):
"""
ALLOWED = ('test_files_source', 'file_whitelist', 'pre_submit_script',
'post_submit_script', 'test_files_subdir',
'submission_parameters', 'submission_scheduler_config',
'_submissions_allowed_from',
'_submissions_allowed_to', '_archive_from',
'submissions_allowed_from',
'submissions_allowed_to', 'archive_from')
'submission_parameters', 'submission_scheduler_config')
for k, w in kwargs.items():
if k in ALLOWED:
setattr(self.config, k, w)
if 'submissions_allowed_from' in kwargs.keys():
self.config.submissions_allowed_from = kwargs['submissions_allowed_from']
if 'submissions_allowed_to' in kwargs.keys():
self.config.submissions_allowed_to = kwargs['submissions_allowed_to']
if 'archive_from' in kwargs.keys():