Skip to content

Commit 85e0fdd

Browse files
authored
Merge pull request #2903 from SaptakS/sponsor-fix
Create Sponsor Fixes
2 parents 5113dc5 + 0d67131 commit 85e0fdd

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

app/api/helpers/custom_fields.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ def format(self, value):
2626
format the text in database for output
2727
works only for GET requests
2828
"""
29-
if not self.validate(value):
30-
print 'Validation of field with value \"%s\" (%s) failed' % (
31-
value, str(self.__class__.__name__))
32-
# raise MarshallingError
33-
# disabling for development purposes as the server crashes when
34-
# exception is raised. can be enabled when the project is mature
3529
if self.__schema_type__ == 'string':
3630
return unicode(value)
3731
else:

app/helpers/wizard/sponsors.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def get_sponsors_json(event_id_or_sponsors):
1616
data = []
1717
for sponsor in sponsors:
1818
data.append(sponsor.serialize)
19-
20-
return data
19+
20+
return sorted(data, key=lambda x: x['id'])
2121

2222

2323
def save_sponsors_from_json(json, event_id=None):
@@ -43,12 +43,11 @@ def save_sponsors_from_json(json, event_id=None):
4343
item.description = sponsor['description']
4444

4545
save_to_db(item)
46-
4746
if item.logo != sponsor['logo']:
4847
if sponsor['logo'] and sponsor['logo'] != '':
4948
item.logo = save_event_image(sponsor['logo'], UPLOAD_PATHS['sponsors']['logo'].format(
5049
event_id=int(event.id), id=int(item.id)
51-
))
50+
), remove_after_upload=False)
5251
else:
5352
item.logo = ''
5453

app/static/js/admin/event/wizard/vue-app.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,11 @@ function save(stepToSave, state, callback) {
390390
state: state
391391
};
392392

393+
/* Commented out for now until better condition is found
393394
if (!_.isUndefined(app.event.id) && !_.isNull(app.event.id) && _.isNumber(app.event.id) && !_.isUndefined(callback)) {
394395
callback();
395396
callback = null;
396-
}
397+
}*/
397398

398399
switch (stepToSave) {
399400
case 'event':
@@ -415,9 +416,10 @@ function save(stepToSave, state, callback) {
415416
makePost('all', data, callback);
416417
break;
417418
default:
419+
/* Commented out for now until better condition is found
418420
if (!_.isUndefined(callback) && !_.isNull(callback)) {
419421
callback();
420-
}
422+
}*/
421423
}
422424
}
423425

app/templates/gentelella/admin/event/wizard/components/image-upload.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h3>{{ '{{ title }}' }} {{ _("is uploading") }}</h3>
2828
</div>
2929
<div class="item form-group" v-if="internalImageUrl && internalImageUrl != ''">
3030
<label>{{ '{{ title }}' }}</label><br>
31-
<img v-bind:src="internalImageUrl" style="max-width: 450px;"><br><br>
31+
<img v-bind:src="internalImageUrl" style="max-width: 300px; max-height: 300px"><br><br>
3232
<button type="button" class="btn btn-sm btn-default" v-on:click="internalImageUrl = ''">
3333
<i class="fa fa-trash-o" aria-hidden="true"></i>
3434
{{ _("Remove") }}

0 commit comments

Comments
 (0)