Skip to content
This repository was archived by the owner on Jan 25, 2020. It is now read-only.

Conversation

@liraisokay
Copy link

#50:

  • now there are jokes between episodes.
  • overall implementation was changed, since old implementation was a bit confusing.
    Usage of inheritance was unjustified and class methods were invoked in the route handlers.

#51:

  • dropzone on form submit invoked XHR requests without following them, thus browser did not show flash messages that notifies about success. I decided that dropzone should be removed, since the form can be done without it, it complicates things and brings undesired dependency
  • separate handlers for Get and Post methods
  • handler for Post method slightly simplified

#52:

  • 'profile' and 'edit_profile' no longer needs parameter, since current user is fetched by flask_login.
  • edit joke and delete joke are decorated with admin_required.

#53

  • 'edit_profile' form is split into 2 separate forms for username edition and password edition
  • the new username is checked for existence

#54:

  • the file is also deleted now

#55:

  • performs test query to the db on init, if operation fails, creates db schema

#56

  • if user is logged - the default page for him is podcast uploading

#57

  • proper on click handler added for the closing x

static = app.config.get('STATIC_ROOT') + f'{self.id}.mp3'
host = app.config.get('HOST', 'localhost:5000')
return f'http://{host}/{Path(static).as_posix()}'
return f"http://{host}{url_for('episodes', path=f'{self.id}.mp3')}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is happening here? why do we have a mix of quotes and why are we building URLs by concatenating strings? 

def check_database_schema_existence():
try:
test_user_id = 1
User.query.get(test_user_id)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it an appropriate test for the existence of the schema? 

jokes = get_jokes_episodes(length)
podcast.episodes = []
for i in range(length):
podcast.episodes.append(jokes[i % len(jokes)])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have all jokes on the application side, why ask the db machinery come up with randomness and then use remainder to select from randomized? You can simply take a  number of jokes and use choice() to get a random one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants