diff options
-rw-r--r-- | pysite/views/main/jams/join.py | 14 | ||||
-rw-r--r-- | pysite/views/staff/jams/actions.py | 3 | ||||
-rw-r--r-- | templates/main/jams/banned.html | 6 | ||||
-rw-r--r-- | templates/staff/jams/infractions/view.html | 10 |
4 files changed, 17 insertions, 16 deletions
diff --git a/pysite/views/main/jams/join.py b/pysite/views/main/jams/join.py index 87a2c4ca..eeae1f76 100644 --- a/pysite/views/main/jams/join.py +++ b/pysite/views/main/jams/join.py @@ -28,9 +28,6 @@ class JamsJoinView(RouteView, DBMixin, OauthMixin): if not self.user_data: return redirect(url_for("discord.login")) - if self.get_response(jam, self.user_data["user_id"]): - return self.render("main/jams/already.html", jam=jam_obj) - infractions = self.get_infractions(self.user_data["user_id"]) for infraction in infractions: @@ -51,6 +48,9 @@ class JamsJoinView(RouteView, DBMixin, OauthMixin): # They already tried to apply for this jam return self.render("main/jams/banned.html", infraction=infraction, jam=jam_obj) + if self.get_response(jam, self.user_data["user_id"]): + return self.render("main/jams/already.html", jam=jam_obj) + form_obj = self.db.get(self.forms_table, jam) questions = [] @@ -73,9 +73,6 @@ class JamsJoinView(RouteView, DBMixin, OauthMixin): if not self.user_data: return redirect(url_for("discord.login")) - if self.get_response(jam, self.user_data["user_id"]): - return self.render("main/jams/already.html", jam=jam_obj) - infractions = self.get_infractions(self.user_data["user_id"]) for infraction in infractions: @@ -96,6 +93,9 @@ class JamsJoinView(RouteView, DBMixin, OauthMixin): # They already tried to apply for this jam return self.render("main/jams/banned.html", infraction=infraction, jam=jam_obj) + if self.get_response(jam, self.user_data["user_id"]): + return self.render("main/jams/already.html", jam=jam_obj) + form_obj = self.db.get(self.forms_table, jam) if not form_obj: @@ -162,14 +162,12 @@ class JamsJoinView(RouteView, DBMixin, OauthMixin): "answers": answers } - print(response) self.db.insert(self.responses_table, response) return self.render("main/jams/thanks.html", jam=jam_obj) def get_response(self, jam, user_id): query = self.db.query(self.responses_table).filter({"jam": jam, "snowflake": user_id}) result = self.db.run(query, coerce=list) - print(result) if result: return result[0] diff --git a/pysite/views/staff/jams/actions.py b/pysite/views/staff/jams/actions.py index f08b3635..1af215a5 100644 --- a/pysite/views/staff/jams/actions.py +++ b/pysite/views/staff/jams/actions.py @@ -183,7 +183,8 @@ class ActionView(APIView, DBMixin): result = self.db.insert(self.infractions_table, { "participant": participant, "reason": reason, - "number": number + "number": number, + "decremented_for": [] }) return jsonify({"id": result["generated_keys"][0]}) diff --git a/templates/main/jams/banned.html b/templates/main/jams/banned.html index adc82fef..fa47c1ec 100644 --- a/templates/main/jams/banned.html +++ b/templates/main/jams/banned.html @@ -18,7 +18,7 @@ permanently banned from participating in our code jams. <br /> <br /> - The reason given is: <span style="font-family: monospace">{{ infraction.reason }}</span> + The reason given is: <strong>{{ infraction.reason }}</strong> <br /> <br /> If you feel that this is a mistake, please feel free to contact one of the admins on Discord. @@ -29,12 +29,12 @@ temporarily banned from participating in our code jams. <br /> <br /> - The reason given is: <span style="font-family: monospace">{{ infraction.reason }}</span> + The reason given is: <strong>{{ infraction.reason }}</strong> <br /> <br /> If you feel that this is a mistake, please feel free to contact one of the admins on Discord. </p> - {% endif + {% endif %} <a class="uk-button uk-button-secondary uk-align-center" href="{{ url_for("main.jams.index") }}"> <i class="uk-icon fa-fw far fa-arrow-left"></i> Back to all code jams diff --git a/templates/staff/jams/infractions/view.html b/templates/staff/jams/infractions/view.html index 0b515cdb..cace2369 100644 --- a/templates/staff/jams/infractions/view.html +++ b/templates/staff/jams/infractions/view.html @@ -51,9 +51,11 @@ <td class="uk-text-truncate" title="{{ infraction.id }}">{{ infraction.id }}</td> <td class="uk-table-shrink"> {% if infraction.participant is not string %} - {{ infraction.participant.username }}#{{ infraction.participant.discriminator }} ({{ infraction.participant.id }}) + <code>{{ infraction.participant.user_id }}</code> + <br /> + ({{ infraction.participant.username }}#{{ infraction.participant.discriminator }}) {% else %} - {{ infraction.participant }} + <code>{{ infraction.participant.user_id }}</code> {% endif %} </td> <td title="{{ infraction.reason }}">{{ infraction.reason }}</td> @@ -314,10 +316,10 @@ } const row = ` <td class="uk-table-shrink"> - <button class="uk-button-small uk-button uk-button-danger delete-infraction-button" style="padding-left: 5px; padding-right: 5px;" data-question-id="${infraction.id}"><i class="uk-icon fa-fw far fa-times"></i></button> + <button class="uk-button-small uk-button uk-button-danger delete-infraction-button" style="padding-left: 5px; padding-right: 5px;" data-infraction-id="${infraction.id}"><i class="uk-icon fa-fw far fa-trash"></i></button> </td> <td class="uk-text-truncate" title="${infraction.id}">${infraction.id}</td> - <td class="uk-table-shrink">${participant}</td> + <td class="uk-table-shrink"><code>${participant}</code></td> <td title="${infraction.reason}">${infraction.reason}</td> <td class="uk-table-shrink">${infraction.number}</td> `; |