Skip to content

Commit

Permalink
Merge pull request #2903 from SaptakS/sponsor-fix
Browse files Browse the repository at this point in the history
Create Sponsor Fixes
  • Loading branch information
SaptakS authored Jan 10, 2017
2 parents 5113dc5 + 0d67131 commit 85e0fdd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
6 changes: 0 additions & 6 deletions app/api/helpers/custom_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ def format(self, value):
format the text in database for output
works only for GET requests
"""
if not self.validate(value):
print 'Validation of field with value \"%s\" (%s) failed' % (
value, str(self.__class__.__name__))
# raise MarshallingError
# disabling for development purposes as the server crashes when
# exception is raised. can be enabled when the project is mature
if self.__schema_type__ == 'string':
return unicode(value)
else:
Expand Down
7 changes: 3 additions & 4 deletions app/helpers/wizard/sponsors.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def get_sponsors_json(event_id_or_sponsors):
data = []
for sponsor in sponsors:
data.append(sponsor.serialize)

return data
return sorted(data, key=lambda x: x['id'])


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

save_to_db(item)

if item.logo != sponsor['logo']:
if sponsor['logo'] and sponsor['logo'] != '':
item.logo = save_event_image(sponsor['logo'], UPLOAD_PATHS['sponsors']['logo'].format(
event_id=int(event.id), id=int(item.id)
))
), remove_after_upload=False)
else:
item.logo = ''

Expand Down
6 changes: 4 additions & 2 deletions app/static/js/admin/event/wizard/vue-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,11 @@ function save(stepToSave, state, callback) {
state: state
};

/* Commented out for now until better condition is found
if (!_.isUndefined(app.event.id) && !_.isNull(app.event.id) && _.isNumber(app.event.id) && !_.isUndefined(callback)) {
callback();
callback = null;
}
}*/

switch (stepToSave) {
case 'event':
Expand All @@ -415,9 +416,10 @@ function save(stepToSave, state, callback) {
makePost('all', data, callback);
break;
default:
/* Commented out for now until better condition is found
if (!_.isUndefined(callback) && !_.isNull(callback)) {
callback();
}
}*/
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h3>{{ '{{ title }}' }} {{ _("is uploading") }}</h3>
</div>
<div class="item form-group" v-if="internalImageUrl && internalImageUrl != ''">
<label>{{ '{{ title }}' }}</label><br>
<img v-bind:src="internalImageUrl" style="max-width: 450px;"><br><br>
<img v-bind:src="internalImageUrl" style="max-width: 300px; max-height: 300px"><br><br>
<button type="button" class="btn btn-sm btn-default" v-on:click="internalImageUrl = ''">
<i class="fa fa-trash-o" aria-hidden="true"></i>
{{ _("Remove") }}
Expand Down

0 comments on commit 85e0fdd

Please sign in to comment.