Add user settings with time zones
This commit is contained in:
		@@ -183,5 +183,26 @@ class CalendarSocialApp(Flask):
 | 
			
		||||
 | 
			
		||||
        return render_template('event-edit.html', form=form)
 | 
			
		||||
 | 
			
		||||
    @staticmethod
 | 
			
		||||
    @route('/settings', methods=['GET', 'POST'])
 | 
			
		||||
    @login_required
 | 
			
		||||
    def settings():
 | 
			
		||||
        """View for user settings
 | 
			
		||||
        """
 | 
			
		||||
 | 
			
		||||
        from .forms import SettingsForm
 | 
			
		||||
        from .models import db
 | 
			
		||||
 | 
			
		||||
        form = SettingsForm(current_user)
 | 
			
		||||
 | 
			
		||||
        if form.validate_on_submit():
 | 
			
		||||
            form.populate_obj(current_user)
 | 
			
		||||
 | 
			
		||||
            db.session.commit()
 | 
			
		||||
 | 
			
		||||
            return redirect(url_for('hello'))
 | 
			
		||||
 | 
			
		||||
        return render_template('user-settings.html', form=form)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
app = CalendarSocialApp(__name__)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user