Skip to content

Commit b2b0577

Browse files
committed
ADDED settings.json to gitignore
1 parent a3c77b7 commit b2b0577

File tree

6 files changed

+35
-25
lines changed

6 files changed

+35
-25
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules/
22
__pycache__/
33
dist/
4-
settings.py
4+
settings.py
5+
settings.json

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ Code based on https://github.com/dternyak/React-Redux-Flask
44

55
This is starter code.
66

7+
## Running The Code
8+
9+
1. Clone the reponsitory
10+
2. Import the project into your favorite editor (thats Visual Studio Code for us!)
11+
3. [TODO] Set y
12+
713
## Contributing
814

915
If you are interested in fixing issues and contributing directly to the code base,
@@ -29,6 +35,11 @@ Please also see our [Code of Conduct](CODE_OF_CONDUCT.md).
2935

3036
The code ships with a set of recommended Visual Studio Code extensions that will empower the developement process of your Flask + React web application. These extensions include rich language support (code completion, go to definition) for both Python and JavaScript, as well as quick deploy to Azure from within VS Code. When the project is imported into VS Code, a notifcation will appear giving you the option to install these extensions.
3137

38+
List of bundled extensions:
39+
40+
* Python Extension for Visual Studio Code
41+
* Azure App Service Extension
42+
3243
## License
3344

3445
Copyright (c) Microsoft Corporation. All rights reserved.

app/models/models.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,13 @@ def add_task(incoming):
7575
user_id=incoming["user_id"],
7676
status=incoming["status"]
7777
)
78-
db.session.add(task)
79-
db.session.commit()
78+
79+
try:
80+
db.session.add(task)
81+
db.session.commit()
82+
return True
83+
except IntegrityError:
84+
return False
8085

8186
@staticmethod
8287
def get_latest_tasks():

app/routes.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ def is_token_valid():
6767
def submit_task():
6868
incoming = request.get_json()
6969

70-
try:
71-
Task.add_task(incoming)
72-
except IntegrityError:
70+
success = Task.add_task(incoming)
71+
if not success:
7372
return jsonify(message="Error submitting task"), 409
7473

7574
return jsonify(success=True)

static/public/index.html

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
<html>
2+
<head>
3+
<meta charset="utf-8">
4+
<title>Flask + React Starter Kit</title>
5+
<meta name="description" content="">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<link rel="shortcut icon" type="image/x-icon" href="%PUBLIC_URL%/favicon.ico?"/>
8+
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='bundle.css') }}"/>
9+
<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500' rel='stylesheet' type='text/css'>
210

3-
<head>
4-
<meta charset="utf-8">
5-
<title>PVSC Standup</title>
6-
<meta name="description" content="">
7-
<meta name="viewport" content="width=device-width, initial-scale=1">
8-
<link rel="shortcut icon" type="image/x-icon" href="%PUBLIC_URL%/favicon.ico?"/>
9-
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='bundle.css') }}"/>
10-
<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500' rel='stylesheet' type='text/css'>
11-
12-
</head>
13-
14-
<body>
15-
<div id="root"></div>
16-
</body>
17-
<script src="{{ url_for('static', filename='bundle.js') }}"></script>
18-
11+
</head>
12+
<body>
13+
<div id="root"></div>
14+
</body>
15+
<script src="{{ url_for('static', filename='bundle.js') }}"></script>
1916
</html>

0 commit comments

Comments
 (0)