Skip to content

Commit

Permalink
addressing comments on imports & naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Rutvikrj26 committed Nov 7, 2023
1 parent 8a51577 commit cff683f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
14 changes: 5 additions & 9 deletions physionet-django/console/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from collections import OrderedDict
from datetime import datetime
from itertools import chain
import stat
from statistics import StatisticsError, median

import notification.utility as notification
Expand Down Expand Up @@ -2989,14 +2988,11 @@ def event_management(request, event_slug):
if "add-event-dataset" in request.POST.keys():
event_dataset_form = EventDatasetForm(request.POST)
if event_dataset_form.is_valid():
if (
selected_event.datasets.filter(
dataset=event_dataset_form.cleaned_data["dataset"],
access_type=event_dataset_form.cleaned_data["access_type"],
is_active=True,
).count()
== 0
):
active_datasets = selected_event.datasets.filter(
dataset=event_dataset_form.cleaned_data["dataset"],
access_type=event_dataset_form.cleaned_data["access_type"],
is_active=True)
if len(active_datasets) == 0:
event_dataset_form.instance.event = selected_event
event_dataset_form.save()
messages.success(
Expand Down
20 changes: 10 additions & 10 deletions physionet-django/events/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.http import JsonResponse
from django.shortcuts import render, get_object_or_404, redirect
from django.contrib import messages
from django.db.models import Q, Prefetch
from django.db.models import Q
from django.contrib.auth.decorators import login_required
from django.forms import modelformset_factory
from django.urls import reverse
Expand Down Expand Up @@ -168,19 +168,19 @@ def event_home(request):
for selected_event in events_all:
all_applications = selected_event.applications.all()
pending_applications = [
app
for app in all_applications
if app.status == EventApplication.EventApplicationStatus.WAITLISTED
application
for application in all_applications
if application.status == EventApplication.EventApplicationStatus.WAITLISTED
]
rejected_applications = [
app
for app in all_applications
if app.status == EventApplication.EventApplicationStatus.NOT_APPROVED
application
for application in all_applications
if application.status == EventApplication.EventApplicationStatus.NOT_APPROVED
]
withdrawn_applications = [
app
for app in all_applications
if app.status == EventApplication.EventApplicationStatus.WITHDRAWN
application
for application in all_applications
if application.status == EventApplication.EventApplicationStatus.WITHDRAWN
]

event_details[selected_event.id] = [
Expand Down

0 comments on commit cff683f

Please sign in to comment.