mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 22:44:24 +01:00
Fix misc bugs
This commit is contained in:
@@ -211,6 +211,7 @@ class TeamSchema(ma.ModelSchema):
|
||||
else:
|
||||
target_team = current_team
|
||||
|
||||
if self.view == "admin":
|
||||
provided_ids = []
|
||||
for f in fields:
|
||||
f.pop("id", None)
|
||||
|
||||
@@ -205,6 +205,7 @@ class UserSchema(ma.ModelSchema):
|
||||
else:
|
||||
target_user = current_user
|
||||
|
||||
if self.view == "admin":
|
||||
provided_ids = []
|
||||
for f in fields:
|
||||
f.pop("id", None)
|
||||
|
||||
@@ -11,6 +11,19 @@ function createTeam(event) {
|
||||
event.preventDefault();
|
||||
const params = $("#team-info-create-form").serializeJSON(true);
|
||||
|
||||
params.fields = [];
|
||||
|
||||
for (const property in params) {
|
||||
if (property.match(/fields\[\d+\]/)) {
|
||||
let field = {};
|
||||
let id = parseInt(property.slice(7, -1));
|
||||
field["field_id"] = id;
|
||||
field["value"] = params[property];
|
||||
params.fields.push(field);
|
||||
delete params[property];
|
||||
}
|
||||
}
|
||||
|
||||
CTFd.fetch("/api/v1/teams", {
|
||||
method: "POST",
|
||||
credentials: "same-origin",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -15,14 +15,17 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ form.website.label }}
|
||||
<small class="float-right text-muted align-text-bottom">Optional</small>
|
||||
{{ form.website(class="form-control") }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ form.affiliation.label }}
|
||||
<small class="float-right text-muted align-text-bottom">Optional</small>
|
||||
{{ form.affiliation(class="form-control") }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ form.country.label }}
|
||||
<small class="float-right text-muted align-text-bottom">Optional</small>
|
||||
{{ form.country(class="form-control custom-select") }}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user