🏡 index : github.com/compromyse/enfold.git

author Raghuram Subramani <raghus2247@gmail.com> 2025-05-12 5:25:31.0 +00:00:00
committer Raghuram Subramani <raghus2247@gmail.com> 2025-05-12 5:25:31.0 +00:00:00
commit
9eeb3f87a015a668e837b67410e23c4b34e248af [patch]
tree
601c464ed8c04f5aba7a34caa37995e86fde7a7f
parent
d7b0d4e4f94d928899887407fc131c808e8aa916
download
9eeb3f87a015a668e837b67410e23c4b34e248af.tar.gz

update



Diff

 web/app/job_manager.py      | 4 ++++
 web/app/main.py             | 3 ++-
 web/app/templates/home.html | 2 ++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/web/app/job_manager.py b/web/app/job_manager.py
index fa486f3..bdbe994 100644
--- a/web/app/job_manager.py
+++ a/web/app/job_manager.py
@@ -20,10 +20,12 @@
        )

    def get_jobs(self):
        queued_jobs = self.q.get_jobs()

        started_job_ids = self.q.started_job_registry.get_job_ids()
        started_jobs = [Job.fetch(job_id, connection=self.redis) for job_id in started_job_ids]

        finished_job_ids = self.q.finished_job_registry.get_job_ids()
        finished_jobs = [Job.fetch(job_id, connection=self.redis) for job_id in finished_job_ids]

        return started_jobs + finished_jobs
        return queued_jobs + started_jobs + finished_jobs
diff --git a/web/app/main.py b/web/app/main.py
index 1266cb8..cc141b8 100644
--- a/web/app/main.py
+++ a/web/app/main.py
@@ -36,6 +36,7 @@
def create_user():
    username = request.form.get('username')
    password = request.form.get('password')
    admin = request.form.get('admin')

    if current_user.admin != True:
        flash('Only admin can create new users.', 'error')
@@ -45,7 +46,7 @@
        flash('Username and password required.', 'error')
        return redirect(url_for('main.home'))

    user = User.create(username, password)
    user = User.create(username, password, admin == 'on')
    if user:
        flash(f'User {username} created successfully.', 'success')
    else:
diff --git a/web/app/templates/home.html b/web/app/templates/home.html
index 32cee4a..797c66d 100644
--- a/web/app/templates/home.html
+++ a/web/app/templates/home.html
@@ -13,6 +13,8 @@
  <form method="post" action="{{ url_for('main.create_user') }}">
      <input type="text" name="username" placeholder="New Username" required>
      <input type="password" name="password" placeholder="New Password" required>
      <label for="admin">Admin?</label>
      <input type="checkbox" name="admin" id="admin" required>
      <button type="submit">Create User</button>
  </form>