95 Commits

Author SHA1 Message Date
Simeon Pursiainen 8164094b44 Edit email.html 2025-01-23 19:13:16 +00:00
Simeon Pursiainen fd12f35e2e Update .gitlab-ci.yml file 2025-01-23 19:09:37 +00:00
Simeon Pursiainen f69615437a Edit email.html 2025-01-23 19:06:02 +00:00
Simeon Pursiainen 533f367b4e Edit Hafv date 2025-01-21 21:18:06 +00:00
Simeon Pursiainen 93202d8a11 skip ci 2025-01-21 20:59:13 +00:00
Simeon Pursiainen e1e1adc397 Changed date for 2025 Hafv 2025-01-21 13:15:02 +00:00
tommi s 0df2d4ab46 Merge branch 'develop' into 'master'
Develop to master

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!98
2023-10-05 13:45:16 +00:00
tommi s 738051355b Merge branch 'develop' into 'master'
fixes

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!97
2023-10-04 18:02:38 +00:00
tommi s 1cf67c7686 Merge branch 'develop' into 'master'
Edit signup email contact address

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!96
2023-10-04 17:26:31 +00:00
tommi s 2ff0cab544 Merge branch 'develop' into 'master'
Kaehmy dates update

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!95
2023-10-03 20:42:29 +00:00
tommi s 2169bad90d Merge branch 'develop' into 'master'
Develop to master

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!93
2023-09-15 09:21:19 +00:00
Aarni Halinen c79d824a8a Merge branch 'develop' into 'master'
Prod deploy: Add log level to gunicorn

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!92
2023-03-27 16:30:59 +00:00
Ilari Ojakorpi 1e14f98f9d Merge branch 'develop' into 'master'
Develop

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!91
2023-03-05 18:03:40 +00:00
Ilari Ojakorpi f51611bbee Merge branch 'develop' into 'master'
Develop to Master

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!90
2023-02-07 14:58:52 +00:00
Ilari Ojakorpi 4373f37dfe Merge branch 'develop' into 'master'
Merge Develop to master

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!89
2022-12-29 13:53:51 +00:00
Ilari Ojakorpi d8fdc2cc74 Merge branch 'develop' into 'master'
Changes to kaehmy categories

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!86
2022-10-05 11:24:00 +00:00
Ilari Ojakorpi eb2ae3368a Merge branch 'develop' into 'master'
Develop to master

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!85
2022-10-05 10:08:08 +00:00
Ilari Ojakorpi f7f63b8670 Merge branch 'develop' into 'master'
Use html templates for kaehmy emails. No translations for now.

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!84
2022-09-23 18:01:33 +00:00
Ilari Ojakorpi 53742e5caa Merge branch 'develop' into 'master'
Update kaehmy page

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!83
2022-09-23 15:29:08 +00:00
Ilari Ojakorpi 2affae7bfd Merge branch 'develop' into 'master'
Develop

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!82
2022-09-19 08:09:20 +00:00
Ilari Ojakorpi f7659e1e1b Merge branch 'develop' into 'master'
Modified paths

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!81
2022-08-17 20:53:54 +00:00
Ilari Ojakorpi a4ae136e1a Merge branch 'develop' into 'master'
juuh eli

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!80
2022-08-16 20:07:54 +00:00
Ilari Ojakorpi 570fff1d7d Merge branch 'develop' into 'master'
Totally works now

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!79
2022-08-16 19:33:24 +00:00
Ilari Ojakorpi 9d116528b9 Merge branch 'develop' into 'master'
Develop

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!78
2022-08-16 18:49:48 +00:00
Ilari Ojakorpi afbdca1501 Merge branch 'develop' into 'master'
Enable GOOGLE_SERVICE_ACCOUNT, should work now..

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!77
2022-08-16 18:14:50 +00:00
Aarni Halinen 03e4ccdf5d Merge branch 'develop' into 'master'
Prod deploy: Fix kaehmy form

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!76
2022-08-11 08:36:29 +00:00
Aarni Halinen 16454ebdf6 Merge branch 'develop' into 'master'
Prod deploy: Disable GOOGLE_SERVICE_ACCOUNT for debugging

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!75
2022-08-11 07:00:05 +00:00
Ilari Ojakorpi 2e2464fb5f Merge branch 'develop' into 'master'
dumdum

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!74
2022-08-09 18:55:55 +00:00
Ilari Ojakorpi caf2113e49 Merge branch 'develop' into 'master'
Merge 'develop' into' master'

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!71
2022-08-09 14:11:42 +00:00
Aarni Halinen c45bcc5442 Merge branch 'develop' into 'master'
Prod deploy: Fix Filebrowser authentication cookie

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!66
2022-07-24 18:26:38 +00:00
Aarni Halinen 2383e2089d Merge branch 'develop' into 'master'
Prod deploy: Add algorithms for FileBrowser JWT verification

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!65
2022-07-24 17:35:33 +00:00
Ilari Ojakorpi 5f467323b5 Merge branch 'develop' into 'master'
Merge 'Develop' into master

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!64
2022-07-06 19:50:50 +00:00
Ilari Ojakorpi a9c122c0d4 Merge branch 'develop' into 'master'
heevi email fix

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!62
2022-05-26 09:28:20 +00:00
Ilari Ojakorpi d4a219290b Merge branch 'develop' into 'master'
Merge develop into master

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!61
2022-05-22 23:08:42 +00:00
Ilari Ojakorpi e74580fdde Merge branch 'develop' into 'master'
Merge develop into master

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!60
2022-05-19 20:58:32 +00:00
Aarni Halinen 8c90471eb1 Merge branch 'develop' into 'master'
Prod deploy: Webhooks (new TG bot setup)

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!55
2022-01-14 00:50:18 +00:00
Aarni Halinen fc73424665 Merge branch 'develop' into 'master'
Prod deploy: Fix Ohlhafv emails

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!52
2022-01-13 20:12:13 +00:00
Aarni Halinen b610a8af6e Merge branch 'develop' into 'master'
Prod deploy: Disable sentry performance monitoring

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!51
2021-11-17 17:30:51 +00:00
Toni Lyttinen 6022b11dc1 Merge branch 'develop' into 'master'
Prod deploy: Sentry & update Ohlhafv page

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!49
2021-11-17 16:22:34 +00:00
Oskari Ponkala 72ea31a887 Merge branch 'develop' into 'master'
Develop

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!47
2021-10-05 08:44:31 +00:00
Oskari Ponkala 40b824355b Merge branch 'develop' into 'master'
Develop

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!45
2021-06-01 08:45:26 +00:00
Aarni Halinen 5f69f34bf3 Merge branch 'develop' into 'master' 2021-05-16 18:43:23 +03:00
Aarni Halinen c0db047cd9 Merge branch 'develop' into 'master' 2021-05-16 18:18:00 +03:00
Aarni Halinen e2c32e81a7 Merge branch 'develop' into 'master'
Prod deploy: Python 3.9, poetry & dependency updates, SendGrid, Managed DB

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!41
2021-05-16 14:54:43 +00:00
Toni Lyttinen 6a65ca32d7 Merge branch 'develop' into 'master'
Merge feed list order fix to master

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!39
2021-04-08 10:22:38 +00:00
Aarni Halinen 99739cd035 Merge branch 'develop' into 'master'
1st Live deploy

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!37
2021-03-31 21:02:11 +00:00
Aarni Halinen 8454e67a92 Merge branch 'develop' into 'master'
Prod deploy

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!36
2021-03-30 17:08:29 +00:00
Aarni Halinen 33c7c20140 Merge branch 'develop' into 'master'
Prod deploy

* Soft deletes

* sahkoinsinoorikilta.fi domain

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!34
2021-01-19 15:42:22 +00:00
Aarni Halinen 5a77b1546d Merge branch 'develop' into 'master'
Azure deploy & Signup flow

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!32
2020-12-12 12:11:09 +00:00
Toni Lyttinen 81971b6da4 Merge branch 'develop' into 'master'
added "toimikunta-appro" date to kaehmy.html

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!28
2020-10-28 13:39:45 +00:00
Toni Lyttinen a68fa9a6d6 Merge branch 'develop' into 'master'
Kaehmy fix Merge

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!27
2020-10-20 18:43:07 +00:00
Toni Lyttinen 034e04a788 Merge branch 'develop' into 'master'
Merge kaehmy changes to master

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!26
2020-10-07 08:48:06 +00:00
Aarni Halinen d416fda39e Merge branch 'develop' into 'master'
SIK100 Seminar email hack

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!23
2020-08-31 01:11:31 +00:00
Aarni Halinen e4fbb58026 Merge branch 'develop' into 'master'
API serializers for signups

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!22
2020-08-29 12:09:55 +00:00
Aarni Halinen 56dfd57698 Merge branch 'develop' into 'master'
Serialize SignupForm visible

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!20
2020-07-25 09:23:14 +00:00
Aarni Halinen 8632aa01da Merge branch 'develop' into 'master'
Signup modifications to production

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!19
2020-07-24 19:29:20 +00:00
Aarni Halinen 8b1f668d38 Merge branch 'develop' into 'master'
Dependency bump, move volumes under static file server

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!17
2020-03-05 19:21:53 +00:00
Toni Lyttinen 027bf5e7bd Merge branch 'develop' into 'master'
Color updates to Ohlhalv

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!16
2020-02-02 14:42:40 +00:00
Toni Lyttinen be22fea3f2 Merge branch 'develop' into 'master'
Updated ohlhafv challenge buttoncolor to match the page background

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!15
2020-02-02 14:26:23 +00:00
Toni Lyttinen 5e434408b0 Merge branch 'develop' into 'master'
New Ohlhafv graphics

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!14
2020-02-02 14:00:17 +00:00
Toni Lyttinen 41762e920f Updated background color to match image 2020-02-02 13:10:41 +00:00
Aarni Halinen f390e1fb1f Merge branch 'develop' into 'master'
api.sika.sik.party

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!13
2019-12-18 18:39:27 +00:00
Aarni Halinen 4e35a73a4b Merge branch 'develop' into 'master'
Update admin login url

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!12
2019-12-17 19:44:45 +00:00
Aarni Halinen 6955659acb Merge branch 'develop' into 'master'
Add filebrowser

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!11
2019-12-17 17:24:04 +00:00
Aarni Halinen dbc7811651 Merge branch 'develop' into 'master'
Update PG, Hackathon commits

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!10
2019-12-17 16:39:12 +00:00
Aarni Halinen 6c4a26eb44 Merge branch 'develop' 2019-10-10 01:05:24 +03:00
Aarni Halinen fb9dbe2cd2 Merge branch 'develop' 2019-10-10 00:46:11 +03:00
Aarni Halinen b346c2122a Merge branch 'develop' into 'master'
Python 3.7 and path fixes

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!7
2019-10-09 21:11:12 +00:00
Aarni Halinen c9c814e405 Merge branch 'develop' 2019-10-09 22:21:57 +03:00
Aarni Halinen 0f72a7ea21 Merge branch 'develop' 2019-10-09 21:18:16 +03:00
Aarni Halinen 135c0309b5 Merge branch 'develop' 2019-10-09 19:33:45 +03:00
Aarni Halinen bd4551a222 Merge branch 'develop' 2019-10-09 19:03:50 +03:00
Aarni Halinen 7fee47f150 Merge branch 'develop' 2019-10-08 23:16:19 +03:00
Aarni Halinen b0dd95fa86 Merge branch 'develop' 2019-10-08 22:17:28 +03:00
Aarni Halinen 9516dbbbea Merge branch 'develop' 2019-10-08 20:55:09 +03:00
Aarni Halinen 5b2546217c Merge branch 'develop' 2019-10-08 19:57:06 +03:00
Aarni Halinen 2646914b8a Merge branch 'develop' 2019-10-08 19:43:01 +03:00
Aarni Halinen 17c00e519b Merge branch 'develop' 2019-10-08 13:04:42 +03:00
Aarni Halinen 389771d106 Merge branch 'develop' 2019-10-08 12:41:51 +03:00
Aarni Halinen ed4e226186 Merge branch 'develop' 2019-10-08 10:19:30 +03:00
Aarni Halinen bc7a8ebd17 Merge branch 'develop' 2019-10-08 10:01:29 +03:00
Aarni Halinen cfdac40d3b Merge branch 'develop' 2019-10-08 09:41:07 +03:00
Aarni Halinen ec4be22552 Merge branch 'develop' 2019-10-08 01:00:41 +03:00
Aarni Halinen 06d5e3c6f4 Merge branch 'develop' 2019-10-08 00:46:46 +03:00
Aarni Halinen 89cd91dbad Merge branch 'develop' 2019-10-08 00:32:54 +03:00
Aarni Halinen 44c091f2d5 Merge branch 'develop' 2019-10-08 00:05:15 +03:00
Aarni Halinen c1b3bedf8d Merge branch 'develop' 2019-10-07 23:53:24 +03:00
Aarni Halinen 3c16029e88 Merge branch 'develop' 2019-10-07 22:03:17 +03:00
Aarni Halinen 41d6f17716 Merge branch 'develop' 2019-10-07 21:28:27 +03:00
Aarni Halinen 2649afdd4b Merge branch 'develop' 2019-10-07 21:19:28 +03:00
Aarni Halinen 8ee514326a Merge branch 'develop' 2019-10-07 21:10:43 +03:00
Aarni Halinen 48e34ece4f Merge branch 'develop' 2019-10-07 20:31:48 +03:00
Aarni Halinen d2af34bf0c Merge branch 'develop' 2019-10-07 19:59:34 +03:00
Aarni Halinen ddf4ad7b8d Merge branch 'develop' 2019-10-07 19:57:32 +03:00
Aarni Halinen 3169191a0d Merge branch 'develop' into 'master'
New Sika & Membership application

See merge request sahkoinsinoorikilta/vtmk/web2.0-backend!3
2019-10-07 16:04:32 +00:00
31 changed files with 5974 additions and 5277 deletions
+6
View File
@@ -0,0 +1,6 @@
members/static/js/lib
infoscreen/static/js/lib
webapp/static/js/lib
static/js/lib
collected_static
venv
+251
View File
@@ -0,0 +1,251 @@
{
"env": {
"browser": true,
"jquery": true
},
"globals": {
"angular": true,
"noty": true,
"_": true,
"moment": true
},
"extends": "eslint:recommended",
"rules": {
"no-unused-vars": "warn",
"accessor-pairs": "error",
"array-bracket-spacing": "off",
"array-callback-return": "error",
"arrow-body-style": "error",
"arrow-parens": "error",
"arrow-spacing": "error",
"block-scoped-var": "off",
"block-spacing": "off",
"brace-style": "off",
"callback-return": "off",
"camelcase": "off",
"capitalized-comments": "off",
"class-methods-use-this": "error",
"comma-dangle": "off",
"comma-spacing": "off",
"comma-style": "off",
"complexity": "off",
"computed-property-spacing": "off",
"consistent-return": "off",
"consistent-this": "off",
"curly": "off",
"default-case": "off",
"dot-location": [
"error",
"property"
],
"dot-notation": "off",
"eol-last": "off",
"eqeqeq": "off",
"func-call-spacing": "error",
"func-name-matching": "error",
"func-names": "off",
"func-style": "off",
"generator-star-spacing": "error",
"global-require": "off",
"guard-for-in": "off",
"handle-callback-err": "off",
"id-blacklist": "error",
"id-length": "off",
"id-match": "error",
"indent": "off",
"init-declarations": "off",
"jsx-quotes": "error",
"key-spacing": "off",
"keyword-spacing": "off",
"line-comment-position": "off",
"linebreak-style": "off",
"lines-around-comment": "off",
"lines-around-directive": "off",
"max-depth": "off",
"max-len": "off",
"max-lines": "off",
"max-nested-callbacks": "error",
"max-params": "off",
"max-statements": "off",
"max-statements-per-line": "off",
"multiline-ternary": "off",
"new-parens": "off",
"newline-after-var": "off",
"newline-before-return": "off",
"newline-per-chained-call": "off",
"no-alert": "error",
"no-array-constructor": "off",
"no-await-in-loop": "error",
"no-bitwise": "off",
"no-caller": "error",
"no-catch-shadow": "off",
"no-confusing-arrow": "error",
"no-constant-condition": [
"error",
{
"checkLoops": false
}
],
"no-continue": "off",
"no-div-regex": "error",
"no-duplicate-imports": "error",
"no-else-return": "off",
"no-empty-function": "off",
"no-eq-null": "off",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-extra-parens": "off",
"no-floating-decimal": "off",
"no-implicit-coercion": [
"error",
{
"boolean": false,
"number": false,
"string": false
}
],
"no-implicit-globals": "off",
"no-implied-eval": "error",
"no-inline-comments": "off",
"no-inner-declarations": [
"error",
"functions"
],
"no-invalid-this": "off",
"no-iterator": "error",
"no-label-var": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-lonely-if": "off",
"no-loop-func": "error",
"no-magic-numbers": "off",
"no-mixed-operators": "off",
"no-mixed-requires": "error",
"no-multi-assign": "off",
"no-multi-spaces": "off",
"no-multi-str": "error",
"no-multiple-empty-lines": "off",
"no-native-reassign": "off",
"no-negated-condition": "off",
"no-negated-in-lhs": "error",
"no-nested-ternary": "off",
"no-new": "error",
"no-new-func": "off",
"no-new-object": "error",
"no-new-require": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-param-reassign": "off",
"no-path-concat": "error",
"no-plusplus": "off",
"no-process-env": "error",
"no-process-exit": "error",
"no-proto": "error",
"no-prototype-builtins": "off",
"no-restricted-globals": "error",
"no-restricted-imports": "error",
"no-restricted-modules": "error",
"no-restricted-properties": "error",
"no-restricted-syntax": "error",
"no-return-assign": "off",
"no-return-await": "error",
"no-script-url": "error",
"no-self-compare": "error",
"no-sequences": "off",
"no-shadow": "off",
"no-shadow-restricted-names": "error",
"no-spaced-func": "error",
"no-sync": "error",
"no-tabs": "off",
"no-template-curly-in-string": "error",
"no-ternary": "off",
"no-throw-literal": "off",
"no-trailing-spaces": "off",
"no-undef-init": "error",
"no-undefined": "off",
"no-underscore-dangle": "off",
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": [
"error",
{
"defaultAssignment": true
}
],
"no-unused-expressions": "off",
"no-use-before-define": "off",
"no-useless-call": "off",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
"no-useless-constructor": "error",
"no-useless-escape": "off",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-var": "off",
"no-void": "off",
"no-warning-comments": "off",
"no-whitespace-before-property": "error",
"no-with": "error",
"object-curly-newline": "off",
"object-curly-spacing": "off",
"object-property-newline": "off",
"object-shorthand": "off",
"one-var": "off",
"one-var-declaration-per-line": "off",
"operator-assignment": "off",
"operator-linebreak": "off",
"padded-blocks": "off",
"prefer-arrow-callback": "off",
"prefer-const": "error",
"prefer-destructuring": [
"error",
{
"array": false,
"object": false
}
],
"prefer-numeric-literals": "error",
"prefer-promise-reject-errors": "error",
"prefer-reflect": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"prefer-template": "off",
"quote-props": "off",
"quotes": "off",
"radix": "off",
"require-await": "error",
"require-jsdoc": "off",
"rest-spread-spacing": "error",
"semi": "off",
"semi-spacing": "off",
"sort-imports": "error",
"sort-keys": "off",
"sort-vars": "off",
"space-before-blocks": "off",
"space-before-function-paren": "off",
"space-in-parens": "off",
"space-infix-ops": "off",
"space-unary-ops": [
"error",
{
"nonwords": false,
"words": false
}
],
"spaced-comment": "off",
"strict": "off",
"symbol-description": "error",
"template-curly-spacing": "error",
"unicode-bom": [
"error",
"never"
],
"valid-jsdoc": "off",
"vars-on-top": "off",
"wrap-iife": "off",
"wrap-regex": "off",
"yield-star-spacing": "error",
"yoda": "off"
}
}
-1
View File
@@ -12,4 +12,3 @@ node_modules/
*.code-workspace
venv/
.venv/
poetry.lock
+168 -168
View File
@@ -1,191 +1,191 @@
stages:
- setup
- audit
- lint
- test
- publish
- deploy
- cleanup
- setup
- audit
- lint
- test
- publish
- deploy
- cleanup
install:
image: node:22
stage: setup
only:
- pushes
script:
- npm ci
artifacts:
paths:
- node_modules
expire_in: 1 week
image: node:14
stage: setup
only:
- pushes
script:
- npm ci
artifacts:
paths:
- node_modules
expire_in: 1 week
audit:
image: python:3.12.9
stage: audit
allow_failure: true
only:
- pushes
needs: []
before_script:
- pip install pip==25.3
- pip install poetry==2.1.1
- poetry config virtualenvs.create false
- poetry install --no-interaction --no-ansi
script:
- safety check
image: python:3.9
stage: audit
only:
- pushes
- develop
except:
- master
needs: []
before_script:
- pip install poetry==1.3.1
- poetry config virtualenvs.create false
- poetry install --no-interaction --no-ansi
script:
- safety check
test:
image: python:3.12.9
stage: test
only:
- pushes
needs: []
services:
- postgres:12
variables:
POSTGRES_DB: ci
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
DB_HOST: postgres
before_script:
- pip install pip==25.3
- pip install poetry==2.1.1
- poetry config virtualenvs.create false
- poetry install --no-interaction --no-ansi
script:
- python manage.py migrate --noinput
- python manage.py createdefaultadmin
- python manage.py test
image: python:3.9
stage: test
only:
- pushes
needs: []
services:
- postgres:12
variables:
POSTGRES_DB: ci
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
DB_HOST: postgres
before_script:
- pip install poetry==1.3.1
- poetry config virtualenvs.create false
- poetry install --no-interaction --no-ansi
script:
- python manage.py migrate --noinput
- python manage.py createdefaultadmin
- python manage.py test
lint:py:
image: python:3.12.9
stage: lint
only:
- pushes
needs: []
script:
- pip install black==22.3.0
- black --check .
image: python:3.9
stage: lint
only:
- pushes
needs: []
script:
- pip install black==22.3.0
- black --check .
lint:js:
image: node:22
stage: lint
only:
- pushes
needs: ["install"]
script:
- npm run lint:js
image: node:14
stage: lint
only:
- pushes
needs: ["install"]
script:
- npm run lint:js
lint:md:
image: node:22
stage: lint
only:
- pushes
needs: ["install"]
script:
- npm run lint:md
image: node:14
stage: lint
only:
- pushes
needs: ["install"]
script:
- npm run lint:md
publish:
image: docker:25-cli
stage: publish
needs: ["test", "lint:py", "lint:js", "lint:md"]
services:
- docker:25-dind
only:
- main
- production
script:
- docker info
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build . -t "$IMAGE_NAME"
- docker push "$IMAGE_NAME"
image: docker:stable
stage: publish
needs: ["test", "lint:py", "lint:js", "lint:md"]
services:
- docker:stable-dind
only:
- develop
- master
script:
- docker info
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build . -t "$IMAGE_NAME"
- docker push "$IMAGE_NAME"
deploy:dev:
image: docker:25-cli
stage: deploy
only:
- main
environment:
name: dev
url: http://api.dev.sahkoinsinoorikilta.fi
variables:
DOCKER_HOST: $DEV_CI_DOCKER_HOST
DOCKER_TLS_VERIFY: 1
before_script:
- mkdir -p ~/.docker
- echo "$DEV_TLSCACERT" > ~/.docker/ca.pem
- echo "$DEV_TLSCERT" > ~/.docker/cert.pem
- echo "$DEV_TLSKEY" > ~/.docker/key.pem
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker stack deploy --with-registry-auth -c stack-compose-dev.yml "$SERVICE_NAME"
after_script:
- docker logout "$CI_REGISTRY"
image: docker:stable
stage: deploy
only:
- develop
environment:
name: dev
url: http://api.dev.sahkoinsinoorikilta.fi
variables:
DOCKER_HOST: $DEV_CI_DOCKER_HOST
DOCKER_TLS_VERIFY: 1
before_script:
- mkdir -p ~/.docker
- echo "$DEV_TLSCACERT" > ~/.docker/ca.pem
- echo "$DEV_TLSCERT" > ~/.docker/cert.pem
- echo "$DEV_TLSKEY" > ~/.docker/key.pem
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker stack deploy --with-registry-auth -c stack-compose-dev.yml "$SERVICE_NAME"
after_script:
- docker logout "$CI_REGISTRY"
deploy:production:
stage: deploy
image: docker:25-cli
only:
- production
environment:
name: production
url: https://api.sahkoinsinoorikilta.fi
when: manual
variables:
DOCKER_HOST: $CI_DOCKER_HOST
DOCKER_TLS_VERIFY: 1
before_script:
- mkdir -p ~/.docker
- echo "$TLSCACERT" > ~/.docker/ca.pem
- echo "$TLSCERT" > ~/.docker/cert.pem
- echo "$TLSKEY" > ~/.docker/key.pem
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker stack deploy --with-registry-auth -c stack-compose.yml "$SERVICE_NAME"
after_script:
- docker logout "$CI_REGISTRY"
stage: deploy
image: docker:stable
only:
- master
environment:
name: production
url: https://api.sahkoinsinoorikilta.fi
when: manual
variables:
DOCKER_HOST: $CI_DOCKER_HOST
DOCKER_TLS_VERIFY: 1
before_script:
- mkdir -p ~/.docker
- echo "$TLSCACERT" > ~/.docker/ca.pem
- echo "$TLSCERT" > ~/.docker/cert.pem
- echo "$TLSKEY" > ~/.docker/key.pem
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker stack deploy --with-registry-auth -c stack-compose.yml "$SERVICE_NAME"
after_script:
- docker logout "$CI_REGISTRY"
docker_prune:dev:
image: docker:stable
stage: cleanup
only:
- schedules
environment:
name: dev
url: http://api.dev.sahkoinsinoorikilta.fi
variables:
DOCKER_HOST: $DEV_CI_DOCKER_HOST
DOCKER_TLS_VERIFY: 1
before_script:
- mkdir -p ~/.docker
- echo "$DEV_TLSCACERT" > ~/.docker/ca.pem
- echo "$DEV_TLSCERT" > ~/.docker/cert.pem
- echo "$DEV_TLSKEY" > ~/.docker/key.pem
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker system prune
after_script:
- docker logout "$CI_REGISTRY"
image: docker:stable
stage: cleanup
only:
- schedules
environment:
name: dev
url: http://api.dev.sahkoinsinoorikilta.fi
variables:
DOCKER_HOST: $DEV_CI_DOCKER_HOST
DOCKER_TLS_VERIFY: 1
before_script:
- mkdir -p ~/.docker
- echo "$DEV_TLSCACERT" > ~/.docker/ca.pem
- echo "$DEV_TLSCERT" > ~/.docker/cert.pem
- echo "$DEV_TLSKEY" > ~/.docker/key.pem
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker system prune
after_script:
- docker logout "$CI_REGISTRY"
docker_prune:prod:
image: docker:stable
stage: cleanup
only:
- schedules
environment:
name: production
url: https://api.sahkoinsinoorikilta.fi
variables:
DOCKER_HOST: $CI_DOCKER_HOST
DOCKER_TLS_VERIFY: 1
before_script:
- mkdir -p ~/.docker
- echo "$TLSCACERT" > ~/.docker/ca.pem
- echo "$TLSCERT" > ~/.docker/cert.pem
- echo "$TLSKEY" > ~/.docker/key.pem
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker system prune
after_script:
- docker logout "$CI_REGISTRY"
image: docker:stable
stage: cleanup
only:
- schedules
environment:
name: production
url: https://api.sahkoinsinoorikilta.fi
variables:
DOCKER_HOST: $CI_DOCKER_HOST
DOCKER_TLS_VERIFY: 1
before_script:
- mkdir -p ~/.docker
- echo "$TLSCACERT" > ~/.docker/ca.pem
- echo "$TLSCERT" > ~/.docker/cert.pem
- echo "$TLSKEY" > ~/.docker/key.pem
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker system prune
after_script:
- docker logout "$CI_REGISTRY"
+1
View File
@@ -0,0 +1 @@
_
Regular → Executable
+3
View File
@@ -1,3 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
PURPLE='\033[0;35m'
NC='\033[0m' # No Color
+3
View File
@@ -1,3 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
PURPLE='\033[0;35m'
NC='\033[0m' # No Color
-1
View File
@@ -1 +0,0 @@
22.13.1
+1 -1
View File
@@ -1 +1 @@
3.12.9
3.9
-2
View File
@@ -1,2 +0,0 @@
python 3.12.9
poetry 2.1.1
+7 -8
View File
@@ -1,13 +1,13 @@
FROM python:3.12.9-slim-bullseye AS builder
FROM python:3.9-slim-buster as builder
ENV PYTHONUNBUFFERED 1
COPY . ./
ENV POETRY_VERSION=2.1.1
RUN pip install pip==25.3
RUN pip install "poetry==$POETRY_VERSION"
RUN poetry self add poetry-plugin-export
RUN poetry export --without-hashes --format=requirements.txt --output requirements.txt
FROM python:3.12.9-slim-bullseye AS server
ENV POETRY_VERSION=1.3.1
RUN pip install "poetry==$POETRY_VERSION"
RUN poetry export --without-hashes > requirements.txt
FROM python:3.9-slim-buster as server
WORKDIR /app
COPY . ./
@@ -22,7 +22,6 @@ ENV PYTHONUNBUFFERED=1 \
PIP_DEFAULT_TIMEOUT=100
RUN apt-get update && apt-get install --no-install-recommends -y build-essential
RUN pip install pip==25.3
RUN pip install --no-deps -r requirements.txt
RUN python manage.py collectstatic --noinput
+23 -45
View File
@@ -2,12 +2,11 @@
[Django](https://www.djangoproject.com/) backend containing multiple small applications and api for Next.js frontend.
* **Web app:** Backend for the main website.
* **Member register:** Data table app for viewing and modifying the member register, member applications and membership payments.
* **Kaehmy:** Form for creating and listing kaehmys
* **Ohlhafv:** Form for creating and listing ohlhafv challenges.
* **Infoscreen:** Angular-based slideshow app for the guild room's screens.
* **Web app:** Backend for the main website.
* **Member register:** Data table app for viewing and modifying the member register, member applications and membership payments.
* **Kaehmy:** Form for creating and listing kaehmys
* **Ohlhafv:** Form for creating and listing ohlhafv challenges.
* **Infoscreen:** Angular-based slideshow app for the guild room's screens.
## Installation
Set up your SSH key authentication in GitLab Profile Settings. Then clone the repository and checkout the development branch:
@@ -15,10 +14,10 @@ Set up your SSH key authentication in GitLab Profile Settings. Then clone the re
```bash
git clone git@gitlab.com:sahkoinsinoorikilta/vtmk/web2.0-backend.git
cd web2.0-backend
git checkout develop
```
Copy env file for local use:
```bash
cp .env.dev .env
```
@@ -30,69 +29,48 @@ For depedencies and virtual environment, we use [poetry](https://python-poetry.o
First install [python](https://wiki.python.org/moin/BeginnersGuide/Download). Then install poetry:
```bash
python -m pip install poetry==2.1.1
python3 -m pip install poetry==1.3.1
```
Install dependencies with
The easiest integration with VSCode is to have poetry install virtual environment in project folder, configured with CMD
```bash
poetry install
```
Poetry is configured to install dependencies in a virtual environment, so you should see `.venv` folder in repo root.
Activate virtual environment in shell
```bash
eval $(poetry env activate)
python3 -m poetry config virtualenvs.in-project true
```
### Node
We use Node.js for few development tasks, like linting.
Easiest way to install Node is [nvm](https://github.com/nvm-sh/nvm).
After installing install dependencies:
We use Node.js for few development tasks, like linting. Easiest way to install Node is [nvm](https://github.com/nvm-sh/nvm). After installing install dependencies:
```bash
```
npm install
```
See [Linting](#linting) for more info
TODO: List scripts
### Database
To run a local development database **[docker](https://docs.docker.com/engine/install/)** is recommended. If you want to additianally use a db management tool **[pgAdmin](https://www.pgadmin.org/download/)** is nice.
After installing docker use the following to create a database:
```bash
docker run --name sik.web.db -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres:12
```
## Development
Install dependencies with
Activate virtual environment in shell
```bash
python3 -m poetry shell
```
Install dependencies
```bash
poetry install
```
and make sure you are using Python from your virutal environment.
Virtual environment can be activated with
```bash
eval $(poetry env activate)
```
and you verify correct Python executable with
```bash
which python
# should return path similar to {your-system path}/web2.0-backend/.venv/bin/python
```
### Initializing data
Run the following `manage.py` commands to initialize a new database. Do not run these in production without thinking!
@@ -128,11 +106,11 @@ Example of creating a feature branch:
git checkout -b feature-branch-name
```
When your changes are ready and the code works without errors, submit a merge request to `main` in GitLab. Another developer reviews your changes and runs the merge. Feature branches should be closed on merge.
When your changes are ready and the code works without errors, submit a merge request to `develop` in GitLab. Another developer reviews your changes and runs the merge. Feature branches should be closed on merge.
Bugfixes do not need their own feature branches and can be pushed straight to `main`, but if the fix needs a notable amount of work, it should be done in a `bugfix` branch instead.
Bugfixes do not need their own feature branches and can be pushed straight to `develop`, but if the fix needs a notable amount of work, it should be done in a `bugfix` branch instead.
Merge requests to `main` should be reviewed by multiple developers. Only a moderator can accept merge requests to `production`.
Merge requests to `master` should be reviewed by multiple developers. Only a moderator can accept merge requests to `master`.
### Linting
@@ -172,4 +150,4 @@ For more information about deployment check **[infra](https://gitlab.com/sahkoin
## GitLab CI
All pushed changes go through the GitLab Continuous Integration, which consists of automated unit testing and linting. Make sure your changes pass both before merging to `main` or `production`.
All pushed changes go through the GitLab Continuous Integration, which consists of automated unit testing and linting. Make sure your changes pass both before merging to `develop` or `master`.
+7 -15
View File
@@ -1,30 +1,22 @@
version: '3'
services:
db:
image: postgres:12
volumes:
- dbdata:/var/lib/postgresql/data
ports:
- 5432:5432
- "5432:5432"
environment:
- POSTGRES_PASSWORD=postgres
web:
build: .
environment:
- DEPLOY_ENV=local
- HOST=localhost
- DEBUG=True
- SECRET_KEY=7p$85^4ibb^p4-=vs44b7!y0e-zemugze18@a#30&71=a8)dp(
- DB_NAME=postgres
- DB_USER=postgres
- DB_PASSWD=postgres
- DB_HOST=db
- DB_PORT=5432
- EMAIL_API_KEY=
- GROUP_KEY=
- GOOGLE_CREDS='{}'
image: registry.gitlab.com/sahkoinsinoorikilta/vtmk/web2.0-backend
env_file:
- .env
ports:
- 8000:8000
- "8000:8000"
depends_on:
- db
-23
View File
@@ -1,23 +0,0 @@
import globals from "globals";
import js from "@eslint/js";
export default [
{
ignores: ["**/.venv/", "**/collected_static/", "**/static/js/lib/**"],
},
{
languageOptions: {
globals: {
...globals.browser,
...globals.jquery,
angular: true,
moment: true,
_: true
},
},
},
{
...js.configs.recommended
}
];
@@ -1,65 +0,0 @@
# Generated by Django 4.2.24 on 2025-10-13 14:48
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("kaehmy", "0011_delete_kaehmybaserole"),
]
operations = [
migrations.AlterField(
model_name="baserole",
name="category",
field=models.CharField(
choices=[
("board", "Board"),
("corporate", "Corporate affairs"),
("freshman", "Freshmen"),
("international", "International"),
("siwa", "SIK's free time"),
("media", "Media"),
("tech", "Technology"),
("wellbeing", "Wellbeing"),
("sikpaja", "Sik-paja"),
("ceremonies", "Ceremonies"),
("studies", "Studies"),
("sosso", "Sössö magazine"),
("pota", "PoTa"),
("alumni", "Alumni relations"),
("n", "N"),
("others", "Others"),
],
default="others",
max_length=255,
verbose_name="Category",
),
),
migrations.AlterField(
model_name="customrole",
name="baserole_ptr",
field=models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="kaehmy.baserole",
),
),
migrations.AlterField(
model_name="presetrole",
name="baserole_ptr",
field=models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="kaehmy.baserole",
),
),
]
+1 -6
View File
@@ -3,13 +3,8 @@
from django.contrib import admin
from members.models import Member, Request, Payment
# Register your models here.
class MemberAdmin(admin.ModelAdmin):
search_fields = ("first_name", "last_name", "email", "POR")
admin.site.register(Member, MemberAdmin)
admin.site.register(Member)
admin.site.register(Request)
admin.site.register(Payment)
+3740 -4754
View File
File diff suppressed because it is too large Load Diff
+7 -9
View File
@@ -9,7 +9,7 @@
"lint:py": "black --diff --check .",
"lint:py:fix": "black .",
"lint:py-type": "pyright",
"prepare": "husky"
"prepare": "husky install"
},
"repository": {
"type": "git",
@@ -17,15 +17,13 @@
},
"author": "SIK ry",
"license": "ISC",
"devDependencies": {
"@eslint/js": "^9.20.0",
"eslint": "^9.20.0",
"globals": "^15.14.0",
"husky": "^9.1.7",
"dependencies": {
"eslint": "^7.28.0",
"husky": "^6.0.0",
"npm-run-all": "^4.1.5",
"pyright": "^1.1.393",
"remark-cli": "^12.0.1",
"remark-preset-lint-recommended": "^7.0.1"
"pyright": "^1.1.149",
"remark-cli": "^9.0.0",
"remark-preset-lint-recommended": "^5.0.0"
},
"remarkConfig": {
"plugins": [
Generated
+1713
View File
File diff suppressed because it is too large Load Diff
+36 -51
View File
@@ -1,65 +1,50 @@
[project]
authors = [
{name = "Aarni Halinen", email = "aarni.halinen@sahkoinsinoorikilta.fi"},
]
description = "Backend for sahkoinsinoorikilta.fi"
[tool.poetry]
name = "web2.0-backend"
readme = "README.md"
requires-python = "~3.12"
version = "0.1.0"
[virtualenvs]
create = true
in-project = true
description = "Backend for sahkoinsinoorikilta.fi"
authors = ["Aarni Halinen aarni.halinen@sahkoinsinoorikilta.fi"]
[tool.poetry.dependencies]
decorator = "^4.4.2"
Django = "^4.2.19"
django-app-namespace-template-loader = "^0.4.1"
django-auditlog = "^2.1.1"
django-autocomplete-light = "^3.4.1"
django-bootstrap3 = "^21.2.0"
python = "^3.9"
decorator = "^4.0.9"
Django = "^4.1"
requests = "^2.28.1"
django-cors-headers = "^3.13.0"
django-filter = "^22.1.0"
django-import-export = "^2.8.0"
django-modeltranslation = "^0.18.4"
django-phonenumber-field = {version = "^6.4.0", extras = ["phonenumbers"]}
django-polymorphic = "^3.1.0"
django-tables2 = "^2.4.1"
djangorestframework = "^3.12.4"
djangorestframework-simplejwt = "^5.5.0"
google-auth = "^2.9.1"
google-api-python-client = "^2.54.0"
gunicorn = "^23.0.0"
psycopg2-binary = "^2.9.3"
django-bootstrap3 = "^21.2"
django-tables2 = "^2.4.1"
django-modeltranslation = "^0.18.4"
django-auditlog = "^2.1.1"
django-phonenumber-field = {version = "^6.3.0", extras = ["phonenumbers"]}
django-autocomplete-light = "^3.4.1"
six = "^1.12.0"
pyexcel = "^0.7.0"
pyexcel-xlsx = "^0.6.0"
django-import-export = "^2.8.0"
openpyxl = "^2.6.4"
django-app-namespace-template-loader = "^0.4.1"
django-filter = "^22.1"
whitenoise = "^6.2.0"
jsonschema = "^4.9.0"
Markdown = "^3.2.2"
openpyxl = "^2.6.4"
Pillow = "^10.0.0"
psycopg2-binary = "^2.9.3"
pyexcel = "^0.7.0"
pyexcel-io = "^0.6.0"
pyexcel-xlsx = "^0.6.0"
python-dotenv = "^0.20.0"
requests = "^2.28.1"
uWSGI = "^2.0.18"
gunicorn = "^20.1.0"
Pillow = "^9.1.1"
sendgrid = "^6.7.0"
sentry-sdk = "^2.24.1"
six = "^1.12.0"
uWSGI = "^2.0.28"
whitenoise = "^6.2.0"
pyjwt = "^2.9.0"
setuptools = "^80.9.0"
sentry-sdk = "^1.4.3"
django-polymorphic = "^3.1.0"
python-dotenv = "^0.20.0"
djangorestframework-simplejwt = "^5.2.0"
google-auth = "^2.9.1"
google-api-python-client = "^2.54.0"
pyexcel-io = "^0.6.6"
[tool.poetry.group.dev.dependencies]
black = "^25.1.0"
[tool.poetry.dev-dependencies]
coverage = "^6.4.2"
safety = "^2.3.4"
[tool.poetry]
package-mode = false
[tool.poetry.requires-plugins]
poetry-plugin-export = "^1.9"
safety = "^2.1.1"
black = "^22.6.0"
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
+1 -1
View File
@@ -12,5 +12,5 @@
"reportMissingImports": true,
"reportMissingTypeStubs": false,
"pythonVersion": "3.12.9"
"pythonVersion": "3.9"
}
+1 -1
View File
@@ -77,7 +77,7 @@
<input type="checkbox" required name="gdpr" value="1">
<span>{% blocktrans %}
Hyväksyn <a href="https://static.sahkoinsinoorikilta.fi/GDPR/Suomeksi/Tietosuojaseloste%20%20Toimihenkilksi%20hakemisen%20rekisteri.pdf" target="_blank">tietosuojaselosteen</a> ja tietojeni tallentamisen.
Hyväksyn <a href="https://static.sahkoinsinoorikilta.fi/GDPR/Tietosuojaseloste%20%E2%80%93%20Toimihenkil%C3%B6ksi%20hakemisen%20rekisteri.pdf" target="_blank">tietosuojaselosteen</a> ja tietojeni tallentamisen.
{% endblocktrans %}
</span>
<br>
+1 -1
View File
@@ -5,6 +5,6 @@
{{ challenge.message }}
{% trans "Muistattehan vahvistaa haasteen paikan päällä Smökissä torstaina 12.2" %}.
{% trans "Muistattehan vahvistaa haasteen paikan päällä Smökissä torstaina 13.2" %}.
{% trans "Käy kurkkaamassa muutkin haasteet osoitteessa" %} {{ url }}
@@ -1,32 +0,0 @@
# Generated by Django 4.2.24 on 2025-10-13 14:48
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
("contenttypes", "0002_remove_content_type_name"),
("webapp", "0082_delete_baserole"),
]
operations = [
migrations.AddField(
model_name="signup",
name="submit_id",
field=models.UUIDField(default=uuid.uuid4, editable=False, null=True),
),
migrations.AlterField(
model_name="basewebhook",
name="polymorphic_ctype",
field=models.ForeignKey(
editable=False,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="polymorphic_%(app_label)s.%(class)s_set+",
to="contenttypes.contenttype",
),
),
]
@@ -1,18 +0,0 @@
# Generated by Django 4.2.24 on 2025-10-13 15:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("webapp", "0083_signup_submit_id_alter_basewebhook_polymorphic_ctype"),
]
operations = [
migrations.AlterField(
model_name="signup",
name="submit_id",
field=models.UUIDField(null=True),
),
]
@@ -1,18 +0,0 @@
# Generated by Django 4.2.24 on 2025-10-13 15:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("webapp", "0084_alter_signup_submit_id"),
]
operations = [
migrations.AlterField(
model_name="signup",
name="submit_id",
field=models.CharField(null=True),
),
]
@@ -1,18 +0,0 @@
# Generated by Django 4.2.24 on 2025-10-13 15:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("webapp", "0085_alter_signup_submit_id"),
]
operations = [
migrations.AlterField(
model_name="signup",
name="submit_id",
field=models.UUIDField(editable=False, null=True),
),
]
@@ -1,18 +0,0 @@
# Generated by Django 4.2.24 on 2025-10-13 15:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("webapp", "0086_alter_signup_submit_id"),
]
operations = [
migrations.AlterField(
model_name="signup",
name="submit_id",
field=models.UUIDField(editable=False, null=True, unique=True),
),
]
-2
View File
@@ -195,8 +195,6 @@ class Signup(models.Model):
email = models.EmailField(blank=True, null=True)
# Random unique identifier. Used for signup editing by the user.
uuid = models.UUIDField(default=uuid4, editable=False)
# Random unique identifier generated by browser upon opening signup form. Used to prevent duplicate signups.
submit_id = models.UUIDField(null=True, editable=False, unique=True)
deleted = models.BooleanField(default=False)
def __str__(self):
+1 -2
View File
@@ -7,7 +7,6 @@ class SignupSerializer(serializers.ModelSerializer):
source="signupForm", queryset=SignupForm.objects.all()
)
list_name = serializers.CharField(read_only=True)
submit_id = serializers.UUIDField(required=False)
def add_extra_fields(self, validated_data):
questions = validated_data["signupForm"].questions
@@ -35,7 +34,7 @@ class SignupSerializer(serializers.ModelSerializer):
class Meta:
model = Signup
fields = ("id", "submit_id", "signupForm_id", "answer", "list_name")
fields = ("id", "signupForm_id", "answer", "list_name")
extra_kwargs = {
"url": {
"view_name": "signup-detail",
-14
View File
@@ -1,7 +1,6 @@
"""Webapp views."""
import json
import time
from jwt import decode
from jwt.exceptions import InvalidTokenError
from django.utils import timezone
@@ -12,7 +11,6 @@ from django.views.decorators.http import require_http_methods
from django_filters import rest_framework as filters
from django.db.models import Prefetch
from django.core.exceptions import ObjectDoesNotExist
from django.db.utils import IntegrityError
from rest_framework import routers
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet, ReadOnlyModelViewSet
@@ -214,14 +212,6 @@ class SignupViewSet(ModelViewSet):
return self.partial_update(request, *args, **kwargs)
def create(self, request, *args, **kwargs):
# Temporary manual duplicate check as submit_id uniqueness is not enforced in deployment database
if "submit_id" in request.data and Signup.objects.filter(
submit_id=request.data["submit_id"]
):
return JsonResponse(
status=200, data={"message": "The submission has already been received"}
)
id = request.data["signupForm_id"]
try:
answer = request.data["answer"]
@@ -236,10 +226,6 @@ class SignupViewSet(ModelViewSet):
return JsonResponse(
status=404, data={"error": f"SignupForm {id} not found"}
)
except IntegrityError:
return JsonResponse(
status=200, data={"message": "The submission has already been received"}
)
else:
return JsonResponse(
status=404, data={"error": f"SignupForm {id} not found"}